interface

SessionTokenStore

Holds a token-transport session for a client. The SDK reads token before every request and reports lifecycle events; the store decides where the token lives. Every event names the token it concerns, so a store ignores a late response for a token that is no longer current.

Properties

PropertyTypeDescription
tokenstring | null | undefinedThe current token. It is read for every request; never cache it in the client.
sessionSession | nullThe latest known session snapshot, exposed as client.auth.session.
issued(token: string, session: Session) => void | Promise<void>Persist a newly issued token. Login and rotation await this before resolving.
verified(token: string, session: Session) => voidRecord a snapshot verified by auth.getSession() for token.
cleared(token: string) => void | Promise<void>Forget token after logout or rejection. Ignore it if another token is now current.

Full signature

interface SessionTokenStore<Session = unknown> { ... }

Source packages/sdk/src/index.ts:24

Methods