Client API Reference
Client
constructor(options: Partial<ClientOptions>)
Creates a new client.
login(ltuid: string, ltoken: string): Required<Client>
Logins to the client.
addCookies(cookies: { ltuid: string; ltoken: string }[])
Adds cookies to the client.
isLogin(): boolean
Type guard to check if the client is logged in.
Routes
Route | Description |
---|---|
dailyReward | The daily reward route. DailyRewards |
gameRecordCard | The game record card route. GameRecordCards |
sprialAbyss | The spiral abyss route. SpiralAbyss |
genshinActivity | The genshin activity route. GenshinActivity |
characters | The characters route. Characters |
genshinUser | The genshin user route. GenshinUser |
realTimeNotes | The real time notes route. RealTimeNotes |
travelDiary | The travel diary route. TravelDiary |
redeemCode | The redeem code route. RedeemCode |
tcg | The tcg route. TCG |
roleCombat | The roleCombat route. TCG |
Client Options
Option | Type | Description |
---|---|---|
language | Language? | The language to use for the API. Defaults to Language.EnglishUS . |
cookieManager | ClientCookieManager? | The cookie manager to use for the API. Defaults to ClientCookieManager . |
debug | boolean? | Whether to enable debug mode. Defaults to false . |
cacheOptions | CacheOptions? | The cache options to use for the API. Defaults to {} . |
Cache Options
Option | Type | Description |
---|---|---|
maxAge | number? | The maximum age of the cache in seconds. Defaults to undefined . |
maxSize | number? | The maximum size of the cache in bytes. Defaults to undefined . |