Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@muffinking-jpeg/wg-api-lib
Advanced tools
Readme
Available on:
This is NodeJS package for easy work with Wargaming.net API. In current version supports only World of Tanks and World of Tanks Blitz.
IMPORTANT!
Starting from october 14th 2022 support for .ru (CIS earlier) will be deprecated.
This package do not support Lesta Games API (and probably will not)
To install package type in console:
npm i @muffinking-jpeg/wg-api-lib
To start using package import this as ES6 module (No support for CommonJS. Let's move forward) and initialize object with your WG api key.
import { wgApi } from '@muffinking-jpeg/wg-api-lib';
...
const api = new wgApi('Put your WG key here')
Best practice is to use environment variables or .env
file to store api keys
File .env
:
...
WG_API_KEY = "YourApiKey"
...
Your code:
import * as dotenv from 'dotenv';
import { wgApi } from '@muffinking-jpeg/wg-api-lib';
...
dotenv.config();
const apiKey = process.env['WG_API_KEY']
const api = new wgApi(apiKey)
...
For searching players by name.
Params | Types | Meaning |
---|---|---|
game: | 'wotb' | 'worldoftanks' | Choosing the game |
region: | 'eu' | 'na' | 'asia' | Choose region of game |
query: | string | Player's name |
For loading player's statistics.
Params | Types | Meaning |
---|---|---|
game: | 'wotb' | 'worldoftanks' | Choosing the game |
region: | 'eu' | 'na' | 'asia' | Choose region of game |
id: | number | Player's id |
For loading player's achievements.
Params | Types | Meaning |
---|---|---|
game: | 'wotb' | 'worldoftanks' | Choosing the game |
region: | 'eu' | 'na' | 'asia' | Choose region of game |
id: | number | Player's id |
api.searchPlayer({
game: 'wotblitz',
query: 'Holly_Carbonara',
region: 'eu'
}).then(res => {
//Your response handler here
})
api.getPlayerData({
game: 'wotblitz',
id: 594863503,
region: 'eu'
}).then(res => {
//Your response handler here
})
api.getPlayerAchievements({
game: 'wotblitz',
id: 594863503,
region: 'eu'
}).then(res => {
//Your response handler here
})
FAQs
Lib for obtaining player statistics in games made by Wargaming.net
The npm package @muffinking-jpeg/wg-api-lib receives a total of 1 weekly downloads. As such, @muffinking-jpeg/wg-api-lib popularity was classified as not popular.
We found that @muffinking-jpeg/wg-api-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.