This repository is an edited version of brawlstars javascript wrapper.
-
This is an unofficial wrapper of the official brawl stars API with proxy. Many developers don't/can't use brawl stars API due to the fact that it is IP bounded. But this solves their problem.
-
The proxy used here is provided by royaleapi.com. You can read the documentation here.
1. Refer the usage page of brawlstars wrapper for more info.
Simply import the Client class and instantiate it with your API token:
// TypeScript, ESM
import { Client } from "Brawl-Stars-API-Proxy";
// CommonJS, Node.js
const { Client } = require("Brawl-Stars-API-Proxy");
// Create instance
const client = new Client("TOKEN", {
cache: true, // default is true
cacheOptions: undefined /* options for node-cache, default is undefined. */
});
// Call into functions
client.getPlayer("TAG")
.then((player) => console.log(player.name))
.catch((err) => console.error(err));You can create an API Token on the official brawl stars developer website.
While creating a "API Token" you will be asked to whitelist IPs, here just simply whitelist 128.128.128.128 IP address:
Click on "Create Key" and you will get your access token. Now just replace the TOKEN with your access token.
Note: You should always keep your token private. With this you would be able to connect with the API from any IP Address.
