The Stytch SDK caches the Session of the logged-in . Use the session.onChange method to listen for and react to changes to the Session object.
Parameters
The callback function to call when the session changes. The first parameter is the updated Session object.
The updated Session object.
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.
Return value
The function to call to unsubscribe from the Session change event.