Blizzard.js is a promise-based Node.js library for the Blizzard Community Platform API.
Install blizzard.js
and save to your package.json
dependencies in one easy step:
With yarn:
$ yarn add blizzard.js
With npm:
$ npm install blizzard.js --save
Step 1: require()
and initialize()
Blizzard.js within your application:
const blizzard = require('blizzard.js').initialize({ apikey: BLIZZARD_API_KEY });
Step 2: Call the API methods to request data:
blizzard.wow.character(['profile'], { origin: 'us', realm: 'amanthul', name: 'charni' })
.then(response => {
console.log(response.data);
});
Step 3: ???
Step 4: Profit.
Your private Blizzard API key must be passed to .initialize()
. Please see the documentation at the Blizzard Developer Portal to obtain your own Blizzard API key.