SuperTokens NodeJS
2.1.X
Docs
Discord
Blog
›
Session Object
SIDEBAR_REPLACE_DOC_Installation
Installation
Usage with express
Minimum setup
User Login
Verify Session
Session Object
Logout / Revoke Session
Custom Error Handling
Handling CORS
Session Handle
API Reference
init
createNewSession
getSession
refreshSession
revokeAllSessionsForUser
revokeSession
revokeMultipleSessions
getAllSessionHandlesForUser
getSessionData
updateSessionData
getJWTPayload
updateJWTPayload
setRelevantHeadersForOptionsAPI
Middleware
supertokens.middleware
supertokens.errorHandler
Error Handling
Overview
GENERAL_ERROR
UNAUTHORISED
TOKEN_THEFT_DETECTED
TRY_REFRESH_TOKEN
isErrorFromAuth
Session Object
Overview
getUserId
getSessionData
updateSessionData
getJWTPayload
updateJWTPayload
revokeSession
revokeSession()
Parameters
none
Returns
Promise<void>
Throws
GENERAL_ERROR
←
Previous