updateSession()
Changes when the given session expires. The new expiry applies to this session only and can exceed the instance's session lifetime. Only active and pending sessions can be updated.
Take the session ID from the sid claim of a verified session token, never from an unverified client request.
Returns the updated Session.
function updateSession(sessionId: string, params: { expireAt: Date }): Promise<Session>- Name
sessionId- Type
string- Description
The ID of the session to update.
- Name
params- Type
{ expireAt: Date; }- Description
The parameters to update the session with.
- Name
params.expireAt- Type
Date- Description
When the session should expire. Must be at least 5 minutes and at most 10 years from now.
const sessionId = 'sess_123'
const expireAt = new Date(Date.now() + 60 * 60 * 1000)
const response = await clerkClient.sessions.updateSession(sessionId, { expireAt })Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint PATCH/sessions/{session_id}. See the BAPI reference for more information.
Feedback
Last updated on