Socket
Book a DemoInstallSign in
Socket

my-awesome-project_pablornc

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

my-awesome-project_pablornc

Brawl API Wrapper is a powerful module to interact with the brawl stars API

1.0.5
unpublished
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

BRAWL API WRAPPER

Brawl API Wrapper is a powerful module to interact with the brawl stars API

INSTALATION

npm i brawl-api-wrapper

FIRST STEPS

First of all you have to get a brawl stars API key

const { Client } = require("brawl-api-wrapper")
const client = new Client("YOUR API KEY GOES HERE")

Or if you're using ES6 import:

import { Client } from "brawl-api-wrapper"
const client = new Client("YOUR API KEY GOES HERE")

GET PLAYER

This method return a player object, we only have to provide the player's tag

const player = await client.getPlayer("PLAYER TAG GOES HERE")
console.log(player.name) // return the player username 

GET PLAYER'S BATTLELOG

This method returns a player battlelog, we have to provide the player's tag

const battlelog = await client.getBattleLog("PLAYER TAG GOES HERE")

Or you can access to a Player property called battlelog

const player = await client.getPlayer("PLAYER TAG GOES HERE")
console.log(player.battlelog) // return the player battlelog 

GET CLUB

This method return a club, we have only to provide the club's tag

const club = await client.getClub("CLUB TAG GOES HERE")
console.log(club.memberCount) // return the number of members of the club

GET BRAWLER

To get a brawler you have to pass the brawlerId that this module provides to you in form of an enum

const { Brawlers } = require("brawl-api-wrapper")
const brawler = await client.getBrawler(Brawlers.Amber)
console.log(brawler.gadgets) // return the gadgets in form of an array

GET ALL BRAWLERS

This method return all the brawlers in form of an array

const brawlers = await client.getBrawlers()
console.log(brawlers) // return an array of all the brawlers

GET RANKINGS

GET RANKING OF PLAYERS TROPHIES

This method returns the 200 players with more trophies of a country.

const topPlayers = await client.getRankingOfPlayers("es") // return the top 200 players with more trophies of Spain, by default return the global top.
console.log(topPlayers)

GET RANKING OF CLUBS

This method return the 200 clubs with more trophies of a country

const topClubs = await client.getRankingOfClubs("es") // return the top 200 clubs with more trophies of Spain, by default return the global top.
console.log(topClubs)

GET RANKING OF BRAWLERS

This method return the 200 players with more trophies of a country.You have to pass the brawlerId in the method so we import the Brawlers enum

const { Brawlers } = require("brawl-api-wrapper")
const topBrawlers = await client.getRankingOfBrawlers(Brawlers.Amber, "es") // return the top 200 players with more trophies with Amber of Spain, by default is the global top

GET EVENT ROTATION

This method return the event rotation of the game

const events = await client.getEvents()
console.log(event) // return an array of events

BUGS

If you find a bug create an issue in the official repository

FAQs

Package last updated on 02 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.