OpaqueSession interface

Public opaque session surface returned to app code. Raw tokens are concealed internally by the Auth SDK.

Properties

expiresAt

When the access token expires.

isAnonymous

Whether the current session is an anonymous session.

isAuthenticated

Whether the session currently holds an access token that has not expired.

This is false while an expired token is waiting to be renewed, for example after the device slept or was offline when the token was due to refresh. In that state user is still set and auth.hasRefreshToken() is true; the SDK renews the token automatically and emits AUTH_REFRESH when it does.

role

The user's role for the session, when known.

user

The authenticated user, or null when signed out.

Property Details

expiresAt

When the access token expires.

expiresAt?: Date

Property Value

Date

isAnonymous

Whether the current session is an anonymous session.

isAnonymous: boolean

Property Value

boolean

isAuthenticated

Whether the session currently holds an access token that has not expired.

This is false while an expired token is waiting to be renewed, for example after the device slept or was offline when the token was due to refresh. In that state user is still set and auth.hasRefreshToken() is true; the SDK renews the token automatically and emits AUTH_REFRESH when it does.

isAuthenticated: boolean

Property Value

boolean

role

The user's role for the session, when known.

role?: string

Property Value

string

user

The authenticated user, or null when signed out.

user: User | null

Property Value

User | null