@dvxch/yandex-music
    Preparing search index...

    Class YnisonClient

    A single Ynison session: performs the redirect → state handshake, dispatches state frames to listeners and keeps the connection alive.

    Reconnection is not built in; callers drive it (see the realtime client).

    Index

    Constructors

    Accessors

    • get lastActivityAt(): number

      Date.now() of the last WS activity on the state socket (any frame, ping or pong), or 0 before the socket opens. Use this — not state-frame arrival — to judge transport liveness: Ynison is legitimately silent while the player is paused/idle, but the keep-alive ping/pong keeps this fresh.

      Returns number

    Methods

    • Run the full handshake (redirect → state). The returned promise resolves when the session closes normally and rejects on a handshake/transport failure.

      Parameters

      • redirectTimeoutMs: number = 10_000

        Timeout for the redirect frame. Defaults to 10000.

      Returns Promise<void>

      On a handshake or transport failure.