Wargamer
A promise-based Node.js client library for the Wargaming.net API. Supports all of the documented APIs listed in the API reference.
- World of Tanks
- World of Tanks Blitz
- World of Tanks Console
- World of Warships
- World of Warplanes
- Wargaming.net
The library currently supports Node.js 4.0.0 and above.
Installation
npm install --save wargamer
or
yarn add wargamer
Web bundles are available as well.
<script src="wargamer.min.js"></script>
<script>
const wot = new wargamer.WorldOfTanks({ });
</script>
The web distribution is hosted on jsDelivr.
Usage
Below is a sample of Wargamer code. More details and examples are available on the documentation site.
import Wargamer from 'wargamer';
const tanks = Wargamer.WoT({ realm: 'ru', applicationId: 'application_id'});
tanks.fetch('account/list', { search: 'Straik' })
.then((response) => {
console.log(response.meta);
console.log(response.data);
}).catch((error) => {
console.log(error.message);
});
References