@blizzard-api/client
Version:
A node.js client to integrate with the blizzard battle.net api.
43 lines (30 loc) • 1.1 kB
Markdown
is meant to be used together with one or more of the packages dedicated to a blizzard game.
Currently available packages are:
- `@blizzard-api/classic-wow`
- `@blizzard-api/d3`
- `@blizzard-api/hs`
- `@blizzard-api/sc2`
- `@blizzard-api/wow`
```sh
npm i @blizzard-api/client
```
```ts
import { createBlizzardApiClient } from '@blizzard-api/client';
//or
import createBlizzardApiClient from '@blizzard-api/client';
import { wow } from '@blizzard-api/wow';
const client = await createBlizzardApiClient({
key: 'environment.blizzardClientId',
secret: 'environment.blizzardClientSecret',
origin: 'eu',
});
//Response will automatically be typed with the appropriate values
const response = await client.sendRequest(wow.commodities());
console.log(response);
^ typeof AuctionHouseCommoditiesResponse
```
Please refer to the [battle.net documentation](https://develop.battle.net/documentation/guides/getting-started) for guides on how to obtain Blizzard API credentials.
This package provides a client that