Skip to content

Documentation


Documentation / @blizzard-api/core / getBlizzardApi

Function: getBlizzardApi() ​

getBlizzardApi<T>(origin, locale?): BlizzardApi<T>

Defined in: blizzard-api.ts:78

Get the Blizzard API configuration for a given region.

Type Parameters ​

T ​

T extends Origins

The region of the Blizzard API.

Parameters ​

origin ​

T

The region of the Blizzard API.

locale? ​

object[T][number]

The locale of the Blizzard API.

Returns ​

BlizzardApi<T>

The Blizzard API configuration for the given region.

Example ​

ts
const api = getBlizzardApi('us', 'en_US');
console.log(api.hostname); // 'https://us.api.blizzard.com'
console.log(api.locale); // 'en_US'
console.log(api.origin); // 'us'