Skip to main content

Class: Hoyolab

Represents the Hoyolab API client.

Constructors​

constructor​

• new Hoyolab(options)

Creates a new instance of Hoyolab.

Throws

If ltuid or ltoken keys are missing in the ICookie object.

Remarks

Because CookieTokenV2 has a short expiration time and cannot be refreshed so far. It is evident that every few days, when logging in, it always requests authentication first. Therefore, this method that uses CookieTokenV2 is not suitable if filled statically.

Parameters​

NameTypeDescription
optionsIHoyolabOptionsThe options to initialize the Hoyolab instance.

Defined in​

src/client/hoyolab/hoyolab.ts:41

Properties​

• Readonly cookie: ICookie

The parsed ICookie object used to authenticate requests.

Defined in​

src/client/hoyolab/hoyolab.ts:17


lang​

• lang: LanguageEnum

The language used for API responses.

Defined in​

src/client/hoyolab/hoyolab.ts:27


request​

• Readonly request: HTTPRequest

The underlying Request object used to make HTTP requests.

Defined in​

src/client/hoyolab/hoyolab.ts:22

Methods​

gameRecordCard​

▸ gameRecordCard(): Promise<IGameRecordCard[]>

Retrieves the game record card

Async

Returns​

Promise<IGameRecordCard[]>

The game account.

Defined in​

src/client/hoyolab/hoyolab.ts:80