Skip to main content
Docs

verifySession() (deprecated)

Caution

This method is now deprecated. Refer to the Manual JWT Verification guide for the recommended way to verify sessions/tokens.

Verifies whether a session with a given ID corresponds to the provided session token. Throws an error if the provided ID is invalid.

Example

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const sessionId = 'my-session-id'

const token = 'my-session-token'

const session = await clerkClient.sessions.verifySession(sessionId, token)
  • Name
    sessionId
    Type
    string
    Description

    The ID of the session to verify.

  • Name
    token
    Type
    string
    Description

    The token of the session to verify with.

Feedback

What did you think of this content?

Last updated on