Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@blizzard-api/core

Pewtro639MIT2.1.1TypeScript support: included

The core helpers used by all @blizzard-api/* packages.

blizzard, battlenet, battle.net, bnet, api, world of warcraft, warcraft, wow, classic, retail, starcraft, sc2, diablo, d3, hs, hearthstone

readme

@blizzard-api/core

This package provides core functionality to the other @blizzard-api/* packages.

Installation

npm i @blizzard-api/core

Usage

The package includes a series of types that define values that are allowed to be passed to Battle.net API.

import type { BlizzardNamespaces, Locales, Origins } from '@blizzard-api/core';

It also includes a helper function to get the origin, hostname and locale easily accessible based off a single origin.

import type { getBlizzardApi } from '@blizzard-api/core';

const { origin, hostname, locale } = getBlizzardApi('eu'); // "kr" | "tw" | "us"