Skip to content
Adrian Preuß edited this page Oct 25, 2025 · 1 revision

Using the API is really easy, see for yourself:

Import

First, you need to import the API into your project. You can do this either via TypeScript or via JavaScript or Node.js:

Via modules import

import {
    // Settings and other Stuff
    Configuration,

    // Usable backends
    PlayElements,
    Blueprints,

    // Models or Enums, if you need it
    Tag,
    Mod,
    PublishState
} from 'battlefield6-api';

Via require

const BF6 = require('battlefield6-api');

/*
    // Settings and other Stuff
    BF6.Configuration,

    // Usable backends
    BF6.PlayElements,
    BF6.Blueprints,

    // Models or Enums, if you need it
    BF6.Tag,
    BF6.Mod,
    BF6.PublishState
*/

Configuration

To connect to the portal server, you need a valid session.

This must be set before the first operation is performed, otherwise you will get an SessionException:

Warning

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

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

You can catch some Exceptions (see Status for more details) with an try/catch-Block:

try {
    // Load all PlayElements without having set before Configuration.setSession
    await PlayElements.list();
} catch(error: SessionException) {
    console.error('YOU ARE NOT LOGGED IN!');
}
General

The actual abstraction layer for retrieving or sending data from the portal server.

⠀⠀ Installation

⠀⠀ Usage

⠀⠀ Examples

Backends

The actual abstraction layer for retrieving or sending data from the portal server.

⠀⠀ Blueprints

⠀⠀ Experience

⠀⠀ Mods⠀⠀⠀⠀

⠀⠀ PlayElements

Models

Model data for simplified use of the data.

⠀⠀ Blueprint

⠀⠀ Creator

⠀⠀ Design

⠀⠀ Map

⠀⠀ MapRotation

⠀⠀ Option

⠀⠀ PlayElement

⠀⠀ Settings

⠀⠀ Tag

⠀⠀ Team

⠀⠀ TeamComposition

Enum

Static data and informations.

⠀⠀ CreatorType

⠀⠀ OptionType

⠀⠀ Status


Clone this wiki locally