Overview
TheSessionData 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
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.Related Types
AccessTokenSet
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
- User - User profile interface
- TokenSet - Token set interface
- Configuration - SDK configuration options