To get the active Session for the currently signed in User, use the useStytchSession hook.
If no User is signed in, the returned value will be null.
In non-React environments, use the session.getSync method to get the Session.
Return Value
The current Session. A unique identifier for a specific Session.
The unique ID of the affected User.
An array of different authentication factors that comprise a Session.
The timestamp when the Session was created. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.
The timestamp when the Session was last accessed. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.
The timestamp when the Session expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.
Provided attributes help with fraud detection. The IP address of the user.
The user agent of the User.
The custom claims map for a Session. Claims can be added to a session during a Sessions authenticate call.
A list of the roles associated with the session.
Whether the Session data is from persistent storage.