SuperTokens · Schema
SuperTokens Session
JSON Schema for a SuperTokens authentication session resource.
AuthenticationOpen SourceSession ManagementSocial LoginPasswordlessIdentityAuthorizationMulti-TenancyNode.jsSelf-Hosted
Properties
| Name | Type | Description |
|---|---|---|
| handle | string | Unique session handle identifier |
| userId | string | User ID this session belongs to |
| userDataInJWT | object | Arbitrary data embedded in the JWT access token |
| userDataInDatabase | object | Arbitrary data stored in the database for this session |
| tenantId | string | Tenant ID for multi-tenant deployments |
| recipeUserId | string | Recipe-specific user ID (may differ from primary userId in account linking) |
| expiry | integer | Session expiry timestamp in milliseconds since epoch |
| timeCreated | integer | Session creation timestamp in milliseconds since epoch |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/api-evangelist/supertokens/main/json-schema/supertokens-session-schema.json",
"title": "SuperTokens Session",
"description": "JSON Schema for a SuperTokens authentication session resource.",
"type": "object",
"properties": {
"handle": {
"type": "string",
"description": "Unique session handle identifier"
},
"userId": {
"type": "string",
"description": "User ID this session belongs to"
},
"userDataInJWT": {
"type": "object",
"description": "Arbitrary data embedded in the JWT access token",
"additionalProperties": true
},
"userDataInDatabase": {
"type": "object",
"description": "Arbitrary data stored in the database for this session",
"additionalProperties": true
},
"tenantId": {
"type": "string",
"description": "Tenant ID for multi-tenant deployments"
},
"recipeUserId": {
"type": "string",
"description": "Recipe-specific user ID (may differ from primary userId in account linking)"
},
"expiry": {
"type": "integer",
"description": "Session expiry timestamp in milliseconds since epoch"
},
"timeCreated": {
"type": "integer",
"description": "Session creation timestamp in milliseconds since epoch"
}
},
"required": ["handle", "userId"],
"$defs": {
"Token": {
"type": "object",
"description": "A SuperTokens token (access or refresh)",
"properties": {
"token": {
"type": "string",
"description": "The token string value"
},
"expiry": {
"type": "integer",
"description": "Token expiry time in milliseconds"
},
"createdTime": {
"type": "integer",
"description": "Token creation time in milliseconds"
}
},
"required": ["token", "expiry"]
},
"User": {
"type": "object",
"description": "A SuperTokens user",
"properties": {
"id": {
"type": "string",
"description": "Unique user ID"
},
"emails": {
"type": "array",
"items": { "type": "string", "format": "email" }
},
"phoneNumbers": {
"type": "array",
"items": { "type": "string" }
},
"timeJoined": {
"type": "integer",
"description": "Timestamp when user first signed up"
},
"tenantIds": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["id", "timeJoined"]
}
}
}