npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

battlefield6-api

v1.0.4

Published

This is an basic API to work with DICE's Portal-Server (Battlefield 6).

Readme

gRPC / protobuf API

This is an basic API to work with DICE's Portal-Server (Battlefield 6).

Configuration

Before you start, set the current sessionId at the configuration, otherwise you will get an Exception:

SessionException [Error]: The request does not have valid authentication credentials for the operation.

Configuration.setSession('web-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');

Installation

npm install

Building

npm run proto:generate

Imports

import * from 'battlefield6-api';

or specified:

import {
    Configuration,
    Blueprint
} from 'battlefield6-api';

Examples

List all Blueprints

import * from 'battlefield6-api';
(async function main() {
    Configuration.setSession('web-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');

    /* Getting all Blueprint ID's */
    try {
        const ids = await Blueprint.list();

        if(ids) {
            console.log('Blueprints: ', ids?.blueprintIds);

            /* Getting all details for given Blueprint ID's */
            const blueprints = await Blueprint.get(ids.blueprintIds);
            
            if(blueprints) {
                console.log('blueprints', JSON.stringify(blueprints, null, 1));
            } else {
                console.error('Can\'t find Blueprints!');
            }
        } else {
            console.error('Can\'t find Blueprint ID\'s!');
        }
    } catch(error: any) {
        console.error(error);
    }
})();

List all PlayElement

import * from 'battlefield6-api';

(async function main() {
    Configuration.setSession('web-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');

    /* Getting all PlayElements */
    try {
        const owned = await PlayElement.list([
            PublishState.ARCHIVED,
            PublishState.DRAFT,
            PublishState.PUBLISHED
        ], true);

       console.log('owned', owned);
    } catch(error: any) {
        console.error(error);
    }
})();

Create a PlayElement

import * from 'battlefield6-api';

(async function main() {
    Configuration.setSession('web-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');

    /* Create a PlayElement */
    try {
        const created = await PlayElement.create({
            name:                   'My first Example',
            publishState:           PublishState.DRAFT,
            description:            { value: 'This is my first created example!' },
            mapRotation:            [],
            mutators:               [],
            assetCategories:        [],
            originalModRules:       [],
            playElementSettings:    null,
            modLevelDataId:         null,
            thumbnailUrl:           { value: '[BB_PREFIX]/glacier/preApprovedThumbnails/fallback-abea2685.jpg' },
            attachments:            []
        });

        console.log('created', created);
    } catch(error: any) {
        console.error(error);
    }
})();

Delete a PlayElement

[!WARNING] This method is not "really" a delete method for a PlayElement, it will not deteled, it will archived internally and get the State PublishState.ARCHIVED!

import * from 'battlefield6-api';

(async function main() {
    Configuration.setSession('web-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');

    /* Delete a PlayElement */
    try {
        await PlayElement.delete('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
    } catch(error: any) {
        console.error(error);
    }
})();

Update a PlayElement

import * from 'battlefield6-api';

(async function main() {
    Configuration.setSession('web-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');

    /* Update a PlayElement */
    try {
        const created = await PlayElement.update('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', {
            name:                   'My updated Example',
            publishState:           PublishState.DRAFT,
            description:            { value: 'This is my first updated example!' },
            mapRotation:            [],
            mutators:               [],
            assetCategories:        [],
            originalModRules:       [],
            playElementSettings:    null,
            modLevelDataId:         null,
            thumbnailUrl:           { value: '[BB_PREFIX]/glacier/preApprovedThumbnails/fallback-abea2685.jpg' },
            attachments:            []
        });

        console.log('created', created);
    } catch(error: any) {
        console.error(error);
    }
})();