1.0.5 • Published 6 years ago
zenith.js v1.0.5
Zenith.js
Zenith.js is a NodeJS module for the Battlerite API.
Instalation
npm install zenith.js
Client
The first thing to do is creating the client with your API key.
const zenithjs = require("zenith.js");
let client = new zenithjs(apiKey);
Players
You can get one or more players from the client.
client.getPlayersByName(["JohnyBro","joltz"]).then((players) => {
console.log(players); //Collection of players
});
If you provide a string, the method will return a Player object . If you provide an array of strings, the method will return a collection of players (max size 6)
Teams
You can get player's teams.
client.getPlayersByName("JohnyBro").then((player) => {
console.log(player); //Player object
player.getTeams().then((teams) => {
console.log(teams); //Collection of teams
});
});
You can specify the season for the teams, 1 is for the early access season 1 and 8 is for the release season 2. If no season is specified it takes the current season.
Collections
Collections are custom classes that extend Map.
Player
Collection of players are mapped with the id of the player.
Team
Collection of teams are mapped with the id of the team.
Champion
Collection of champions are mapped with the name of the champion.
To-do
- Matches support
- Request rate limit