@blizzard-api/client
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@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:

  • @blizzard-api/d3
  • @blizzard-api/wow
  • @blizzard-api/classic-wow

Planned packages are:

  • @blizzard-api/hs
  • @blizzard-api/sc2

Installation

npm i @blizzard-api/client

Usage

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.data);
                      ^ typeof AuctionHouseCommoditiesResponse

Authentication

Please refer to the battle.net documentation for guides on how to obtain Blizzard API credentials.

/@blizzard-api/client/

    Package Sidebar

    Install

    npm i @blizzard-api/client

    Weekly Downloads

    105

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    62 kB

    Total Files

    8

    Last publish

    Collaborators

    • laustsf