Skip to main content
sessions.authenticate wraps the Authenticate Session endpoint and validates that the session issued to the user is still valid. The SDK will invoke this method automatically in the background.
This method is used by the Stytch SDK internally to refresh session tokens on a regular cadence, so you probably won’t need to call this method directly. However, if you want to manually refresh the session token, you can call this method.

Parameters

number
required
Set the session lifetime to be this many minutes from now. This will return both an opaque session_token and session_jwt for this session, which will automatically be stored in the browser cookies. The session_jwt will have a fixed lifetime of five minutes regardless of the underlying session duration, and will be automatically refreshed by the SDK in the background over time.This value must be a minimum of 5 and may not exceed the maximum session duration minutes value set in the Frontend SDK page of the Stytch Dashboard.A successful authentication will continue to extend the session this many minutes.

Response

string
The JSON Web Token (JWT) for a given Stytch Session.
string
A secret token for a given Stytch Session.
object
The Member Session object.
object
The Member associated with the Session.
object
The Organization associated with the Member’s Session.
string
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
number
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.