bbr-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

bbr-api

An API wrapper for the BattleBit Remastered public API.

License Version

Installation

You can install the package using npm:

npm install bbr-api

Usage

After installation, you can import the Client class from the package and create a new instance of the API client. Here's an example:

const { Client } = require('bbr-api');

const bbrApiClient = new Client();

Once you have the API client instantiated, you can make API requests. For example, you can use the getServerList() method to retrieve the list of servers. Here's an example that logs a few details about each server:

async function main() {
  const response = await bbrApiClient.getServerList();

  response.servers.forEach(server => {
    console.log({
      name: server.Name,
      map: server.Map,
      players: server.Players,
      isOfficial: server.IsOfficial,
    });
  });
}

main();

This example fetches the server list and iterates over each server, logging the server name, map, number of players, and whether it is an official server.

Please note that there are currently no other endpoints available. More endpoints will be added in the future as soon as they are available within the BattleBit Remastered API.

Readme

Keywords

Package Sidebar

Install

npm i bbr-api

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

24.2 kB

Total Files

31

Last publish

Collaborators

  • dasischbims