Skip to main content

Overview

The SessionData interface represents the complete session state for an authenticated user. This includes user profile information, access tokens, and internal session management data.

Type Definition

Properties

User
required
The authenticated user’s profile information. See User for details.
TokenSet
required
The primary token set containing access token, ID token, and refresh token. See TokenSet for details.
AccessTokenSet[]
Array of additional access tokens for different audiences when using Multi-Resource Refresh Tokens (MRRT). Each token is scoped to a specific API audience.
object
required
Internal session management data maintained by the SDK.
ConnectionTokenSet[]
Array of token sets for connected accounts (third-party authentication providers linked to the user’s profile).
unknown
Additional custom properties can be added to the session using the beforeSessionSaved hook.

AccessTokenSet

Represents an access token for a specific audience in Multi-Resource Refresh Token scenarios.

Usage Examples

Get Session in Server Components (App Router)

Get Session in API Routes (Pages Router)

Update Session

Modify Session with beforeSessionSaved Hook

Session Storage

By default, sessions are stored in encrypted cookies (stateless). For large sessions or server-side revocation, use a custom session store:

See Also