@blizzard-api/client
This package provides a client that is meant to be used together with one or more of the packages dedicated to a blizzard game.
Currently available packages are:
Planned packages are:
@blizzard-api/d3
@blizzard-api/hs
@blizzard-api/owl
@blizzard-api/sc2
@blizzard-api/wow-classic
Installation
npm i @blizzard-api/client
Usage
import { BlizzardApiClient } from '@blizzard-api/client';
import { wow } from '@blizzard-api/wow';
const client = new BlizzardApiClient({
key: 'environment.blizzardClientId',
secret: 'environment.blizzardClientSecret',
origin: 'eu',
});
const access = await client.getAccessToken();
client.setAccessToken(access.data.access_token);
const response = await client.sendRequest(wow.commodities());
console.log(response.data);
^ typeof AuctionHouseCommoditiesResponse
Authentication
Please refer to the battle.net documentation for guides on how to obtain Blizzard API credentials.