Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Latest commit

 

History

History
76 lines (64 loc) · 2.09 KB

README.md

File metadata and controls

76 lines (64 loc) · 2.09 KB

brawlstats

An advanced tags system for slash commands

GitHub npm

Archived

This repo has been moved to Monorepo

Description

An advanced API wrapper for the Brawl Stars API.

Features

  • Written in Typescript.
  • Supports both ES modules and CommonJS.

Installation

yarn add brawlstats
# or npm install brawlstats
# or pnpm add brawlstats

Usage

With ESM

import { Client, LogLevel } from 'brawlstats';
const client = new Client({
	/**
	 * Your Brawl Stars API key.
	 * @defaults to the environment variable `BRAWLSTATS_TOKEN`
	*/
	token: 'your-api-key'
})

// get a player
const player = await client.getPlayer('#22QJ0JPVJ');
// or a club
const club = await client.getClub('#XYZ');
// or events rotation
const events = await client.getRotation();
// or all brawlers available in the game
const brawlers = await client.getBrawlers();

With CJS

const { Client, LogLevel } = require('brawlstats');
const client = new Client({
	/**
	 * Your Brawl Stars API key.
	 * @defaults to the environment variable `BRAWLSTATS_TOKEN`
	*/
	token: 'your-api-key'
})

(async () => {
	// get a player
	const player = await client.getPlayer('#22QJ0JPVJ');
	// or a club
	const club = await client.getClub('#XYZ');
	// or events rotation
	const events = await client.getRotation();
	// or all brawlers available in the game
	const brawlers = await client.getBrawlers();
})();

Miscallaneous