Skip to main content

SpaAuthApi

For AI agents: see llms.txt for the complete documentation index. Markdown versions are available by adding .md to a page URL or requesting Accept: text/markdown.

The refresh and sign-out API for a SPA client, where JS holds the refresh token directly.

Refreshing resolves to a RefreshResult: rotated carries the next refresh token to persist, and noSession means the session is gone.

Properties​

PropertyType
refreshSession(refreshToken) => Promise< | { kind: "rotated"; tokens: { accessToken: string; refreshToken: string; refreshTokenExpiresAt: number; userId: string; }; } | { kind: "noSession"; }>
signOut(refreshToken) => Promise<void>