Class HonkaiStarRail

Class representing the Honkai Star Rail game.

Constructors

Properties

cookie: ICookie

The cookie used for authentication.

The Daily module for the Honkai Star Rail game.

The HSRRecordModule object provides an interface to interact with the user record feature in Honkai Star Rails.

redeem: RedeemModule

The Redeem module for the Honkai Star Rail game.

region: null | string

The region of the Honkai Star Rail account.

uid: null | number

The UID of the Honkai Star Rail account.

Accessors

  • get account(): null | IGame
  • Getter for the account property.

    Returns null | IGame

    The current value of the account property.

  • set account(game): void
  • Setter for the account property. Prevents from changing the value once set

    Parameters

    • game: null | IGame

      The game object to set as the account.

    Returns void

Methods

  • Create a new instance of HonkaiStarRail using a Hoyolab account. If uid is not provided in the options, the account with the highest level will be used.

    Parameters

    • options: IHsrOptions

      The options for the HonkaiStarRail instance.

    Returns Promise<HonkaiStarRail>

    • A promise that resolves with a new HonkaiStarRail instance.

    If an object is instantiated from this method but options.cookie.cookieTokenV2 is not set, it will throw an error. This method will access an Endpoint that contains a list of game accounts, which requires the cookieTokenV2 option.