diff --git a/docs/classes/framework.BaseRequest.html b/docs/classes/framework.BaseRequest.html index d8105a866..3579cd2e2 100644 --- a/docs/classes/framework.BaseRequest.html +++ b/docs/classes/framework.BaseRequest.html @@ -1 +1 @@ -
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Short-hand for:
req.protocol == 'https'
-The net.Socket
object associated with the connection.
With HTTPS support, use request.socket.getPeerCertificate()
to obtain the
client's authentication details.
Access: read only and the public server interface. The server object.
-An object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition.
The parsed request URI.
diff --git a/docs/interfaces/framework_koa.SessionContext.html b/docs/interfaces/framework_koa.SessionContext.html index 58f4e7b8e..50bea3e0f 100644 --- a/docs/interfaces/framework_koa.SessionContext.html +++ b/docs/interfaces/framework_koa.SessionContext.html @@ -81,7 +81,7 @@Short-hand for:
this.protocol == 'https'
-Return the request socket.
Check if the request is stale, aka diff --git a/docs/interfaces/framework_loopback.SessionContext.html b/docs/interfaces/framework_loopback.SessionContext.html index 0345b2268..c1612bf24 100644 --- a/docs/interfaces/framework_loopback.SessionContext.html +++ b/docs/interfaces/framework_loopback.SessionContext.html @@ -14,7 +14,7 @@
A flag to tell if the response is finished.
Scope for binding resolution
-Manager for observer subscriptions
Indexer for bindings by tag
diff --git a/docs/interfaces/recipe_session.SessionContainer.html b/docs/interfaces/recipe_session.SessionContainer.html index f70f1bc0a..a649ef657 100644 --- a/docs/interfaces/recipe_session.SessionContainer.html +++ b/docs/interfaces/recipe_session.SessionContainer.html @@ -1 +1 @@ -Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
We pass in the email as well to this function cause the input userId may not be associated with an emailpassword account. In this case, we need to know which email to use to create an emailpassword account later on.
-Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
We do not add a GeneralErrorResponse response to this API since it's not something that is directly called by the user on the frontend anyway
-Used to retrieve all session information for a given session handle. Can be used in place of:
Returns undefined if the sessionHandle does not exist
-Returns false if the sessionHandle does not exist
-Generated using TypeDoc
Returns false if the sessionHandle does not exist
+Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Updates the metadata object of the user by doing a shallow merge of the stored and the update JSONs and removing properties set to null on the root level of the update object. e.g.:
@@ -7,4 +7,4 @@{ "notifications": { "sms": true }, "todos": null }
{ "preferences": { "theme":"dark" }, "notifications": { "sms": true } }
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass CollectingResponse
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns CollectingResponse
Properties
Optional body
Readonly cookies
Readonly headers
original
status Code
wrapper Used
Methods
remove Header
Parameters
key: string
Returns void
sendHTMLResponse
Parameters
html: string
Returns void
sendJSONResponse
Parameters
content: any
Returns void
set Cookie
Parameters
key: string
value: string
domain: undefined | string
secure: boolean
httpOnly: boolean
expires: number
path: string
sameSite: "strict" | "lax" | "none"
Returns void
set Header
Parameters
key: string
value: string
allowDuplicateKey: boolean
Returns void
set Status Code
Parameters
statusCode: number
Returns void
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass PreParsedRequest
Hierarchy
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
request: RequestInfo
Returns PreParsedRequest
Properties
Private Optional _session
original
Private request
wrapper Used
Accessors
session
Returns undefined | SessionContainer
Parameters
value: undefined | SessionContainer
Returns void
Methods
get Cookie Value
Parameters
key: string
Returns undefined | string
get Form Data
Returns Promise<any>
Protected get Form Data From Request Body
Returns Promise<any>
get Header Value
Parameters
key: string
Returns undefined | string
getJSONBody
Returns Promise<any>
Protected getJSONFrom Request Body
Returns Promise<any>
get Key Value From Query
Parameters
key: string
Returns undefined | string
get Method
Returns HTTPMethod
get OriginalURL
Returns string
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass PreParsedRequest
Hierarchy
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
request: RequestInfo
Returns PreParsedRequest
Properties
Private Optional _session
original
Private request
wrapper Used
Accessors
session
Returns undefined | SessionContainer
Parameters
value: undefined | SessionContainer
Returns void
Methods
get Cookie Value
Parameters
key: string
Returns undefined | string
get Form Data
Returns Promise<any>
Protected get Form Data From Request Body
Returns Promise<any>
get Header Value
Parameters
key: string
Returns undefined | string
getJSONBody
Returns Promise<any>
Protected getJSONFrom Request Body
Returns Promise<any>
get Key Value From Query
Parameters
key: string
Returns undefined | string
get Method
Returns HTTPMethod
get OriginalURL
Returns string
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass RecipeUserId
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
recipeUserId: string
Returns RecipeUserId
Properties
Private recipe User Id
Methods
get As String
Returns string
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass RecipeUserId
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
recipeUserId: string
Returns RecipeUserId
Properties
Private recipe User Id
Methods
get As String
Returns string
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass User
Hierarchy
Implements
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
user: UserWithoutHelperFunctions
Returns User
Properties
Readonly emails
Readonly id
Readonly is Primary User
Readonly login Methods
Readonly phone Numbers
Readonly tenant Ids
Readonly third Party
Readonly time Joined
Methods
to Json
Returns JSONObject
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass User
Hierarchy
Implements
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
user: UserWithoutHelperFunctions
Returns User
Properties
Readonly emails
Readonly id
Readonly is Primary User
Readonly login Methods
Readonly phone Numbers
Readonly tenant Ids
Readonly third Party
Readonly time Joined
Methods
to Json
Returns JSONObject
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static Recipe User Id
Static User
Static init
Type declaration
Parameters
config: TypeInput
Returns void
Methods
Static convert To Recipe User Id
Parameters
recipeUserId: string
Returns RecipeUserId
Static create User Id Mapping
Parameters
input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: Record<string, any> }
external User Id: string
Optional external User Id Info?: string
Optional force?: boolean
super Tokens User Id: string
Optional user Context?: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
Static delete User
Parameters
userId: string
removeAllLinkedAccounts: boolean = true
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" }>
Static delete User Id Mapping
Parameters
input: { force?: boolean; userContext?: Record<string, any>; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional force?: boolean
Optional user Context?: Record<string, any>
user Id: string
Optional user Id Type?: "SUPERTOKENS" | "EXTERNAL" | "ANY"
Returns Promise<{ didMappingExist: boolean; status: "OK" }>
Static get AllCORSHeaders
Returns string[]
Static get Request From User Context
Parameters
userContext: undefined | UserContext
Returns undefined | BaseRequest
Static get User
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<undefined | User>
Static get User Count
Parameters
Optional includeRecipeIds: string[]
Optional tenantId: string
Optional userContext: Record<string, any>
Returns Promise<number>
Static get User Id Mapping
Parameters
input: { userContext?: Record<string, any>; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional user Context?: Record<string, any>
user Id: string
Optional user Id Type?: "SUPERTOKENS" | "EXTERNAL" | "ANY"
Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
Static get Users Newest First
Parameters
input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: Record<string, any> }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Optional query?: {}
[key: string]: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<{ nextPaginationToken?: string; users: User[] }>
Static get Users Oldest First
Parameters
input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: Record<string, any> }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Optional query?: {}
[key: string]: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<{ nextPaginationToken?: string; users: User[] }>
Static list Users By Account Info
Parameters
tenantId: string
accountInfo: AccountInfo
doUnionOfAccountInfo: boolean = false
Optional userContext: Record<string, any>
Returns Promise<User[]>
Static update Or Delete User Id Mapping Info
Parameters
input: { externalUserIdInfo?: string; userContext?: Record<string, any>; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional external User Id Info?: string
Optional user Context?: Record<string, any>
user Id: string
Optional user Id Type?: "SUPERTOKENS" | "EXTERNAL" | "ANY"
Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static Recipe User Id
Static User
Static init
Type declaration
Parameters
config: TypeInput
Returns void
Methods
Static convert To Recipe User Id
Parameters
recipeUserId: string
Returns RecipeUserId
Static create User Id Mapping
Parameters
input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: Record<string, any> }
external User Id: string
Optional external User Id Info?: string
Optional force?: boolean
super Tokens User Id: string
Optional user Context?: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
Static delete User
Parameters
userId: string
removeAllLinkedAccounts: boolean = true
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" }>
Static delete User Id Mapping
Parameters
input: { force?: boolean; userContext?: Record<string, any>; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional force?: boolean
Optional user Context?: Record<string, any>
user Id: string
Optional user Id Type?: "SUPERTOKENS" | "EXTERNAL" | "ANY"
Returns Promise<{ didMappingExist: boolean; status: "OK" }>
Static get AllCORSHeaders
Returns string[]
Static get Request From User Context
Parameters
userContext: undefined | UserContext
Returns undefined | BaseRequest
Static get User
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<undefined | User>
Static get User Count
Parameters
Optional includeRecipeIds: string[]
Optional tenantId: string
Optional userContext: Record<string, any>
Returns Promise<number>
Static get User Id Mapping
Parameters
input: { userContext?: Record<string, any>; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional user Context?: Record<string, any>
user Id: string
Optional user Id Type?: "SUPERTOKENS" | "EXTERNAL" | "ANY"
Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
Static get Users Newest First
Parameters
input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: Record<string, any> }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Optional query?: {}
[key: string]: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<{ nextPaginationToken?: string; users: User[] }>
Static get Users Oldest First
Parameters
input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: Record<string, any> }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Optional query?: {}
[key: string]: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<{ nextPaginationToken?: string; users: User[] }>
Static list Users By Account Info
Parameters
tenantId: string
accountInfo: AccountInfo
doUnionOfAccountInfo: boolean = false
Optional userContext: Record<string, any>
Returns Promise<User[]>
Static update Or Delete User Id Mapping Info
Parameters
input: { externalUserIdInfo?: string; userContext?: Record<string, any>; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional external User Id Info?: string
Optional user Context?: Record<string, any>
user Id: string
Optional user Id Type?: "SUPERTOKENS" | "EXTERNAL" | "ANY"
Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default<T>
Type Parameters
T
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type Parameters
T
Parameters
config: TypeInputWithService<T>
Returns default<T>
Properties
ingredient Interface Impl
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default<T>
Type Parameters
T
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type Parameters
T
Parameters
config: TypeInputWithService<T>
Returns default<T>
Properties
ingredient Interface Impl
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default<T>
Type Parameters
T
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type Parameters
T
Parameters
config: TypeInputWithService<T>
Returns default<T>
Properties
ingredient Interface Impl
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default<T>
Type Parameters
T
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type Parameters
T
Parameters
config: TypeInputWithService<T>
Returns default<T>
Properties
ingredient Interface Impl
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static can Create Primary User
Parameters
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
Static can Link Accounts
Parameters
recipeUserId: RecipeUserId
primaryUserId: string
Optional userContext: Record<string, any>
Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
Static create Primary User
Parameters
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
Static create Primary User Id Or Link Accounts
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static can Create Primary User
Parameters
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
Static can Link Accounts
Parameters
recipeUserId: RecipeUserId
primaryUserId: string
Optional userContext: Record<string, any>
Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
Static create Primary User
Parameters
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
Static create Primary User Id Or Link Accounts
This is a function which is a combination of createPrimaryUser and linkAccounts where the input recipeUserId is either linked to a user that it can be linked to, or is made into a primary user.
The output will be the user ID of the user that it was linked to, or it will be the same as the input recipeUserId if it was made into a primary user, or if there was no linking that happened.
-Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<User>
Static get Primary User That Can Be Linked To Recipe User Id
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<User>
Static get Primary User That Can Be Linked To Recipe User Id
This function returns the primary user that the input recipe ID can be linked to. It can be used to determine which primary account the linking will happen to if the input recipe user ID was to be linked.
If the function returns undefined, it means that there is no primary user that the input recipe ID can be linked to, and therefore it can be made into a primary user itself.
-Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<undefined | User>
Static is Email Change Allowed
Parameters
recipeUserId: RecipeUserId
newEmail: string
isVerified: boolean
Optional session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static is Sign In Allowed
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static is Sign Up Allowed
Parameters
tenantId: string
newUser: AccountInfoWithRecipeId
isVerified: boolean
Optional session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static link Accounts
Parameters
recipeUserId: RecipeUserId
primaryUserId: string
Optional userContext: Record<string, any>
Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
Static unlink Account
Parameters
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>
Generated using TypeDoc
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<undefined | User>
Static is Email Change Allowed
Parameters
recipeUserId: RecipeUserId
newEmail: string
isVerified: boolean
Optional session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static is Sign In Allowed
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static is Sign Up Allowed
Parameters
tenantId: string
newUser: AccountInfoWithRecipeId
isVerified: boolean
Optional session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static link Accounts
Parameters
recipeUserId: RecipeUserId
primaryUserId: string
Optional userContext: Record<string, any>
Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
Static unlink Account
Parameters
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static consume Password Reset Token
Parameters
tenantId: string
token: string
Optional userContext: Record<string, any>
Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
Static create Reset Password Link
Parameters
tenantId: string
userId: string
email: string
Optional userContext: Record<string, any>
Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static create Reset Password Token
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static consume Password Reset Token
Parameters
tenantId: string
token: string
Optional userContext: Record<string, any>
Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
Static create Reset Password Link
Parameters
tenantId: string
userId: string
email: string
Optional userContext: Record<string, any>
Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static create Reset Password Token
We do not make email optional here cause we want to allow passing in primaryUserId. If we make email optional, and if the user provides a primaryUserId, then it may result in two problems:
@@ -9,4 +9,4 @@ or has wrong email compared to what the user wanted to generate a reset token for.And we want to allow primaryUserId being passed in.
-Parameters
tenantId: string
userId: string
email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static reset Password Using Token
Parameters
tenantId: string
token: string
newPassword: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
Static send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: Record<string, any> }
Returns Promise<void>
Static send Reset Password Email
Parameters
tenantId: string
userId: string
email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
Static sign In
Parameters
tenantId: string
email: string
password: string
Optional session: undefined
Optional userContext: Record<string, any>
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Parameters
tenantId: string
email: string
password: string
session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | { reason: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "EMAIL_VERIFICATION_REQUIRED" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED" }>
Static sign Up
Parameters
tenantId: string
email: string
password: string
Optional session: undefined
Optional userContext: Record<string, any>
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Parameters
tenantId: string
email: string
password: string
session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "EMAIL_VERIFICATION_REQUIRED" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED" }>
Static update Email Or Password
Parameters
input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: Record<string, any> }
Optional apply Password Policy?: boolean
Optional email?: string
Optional password?: string
recipe User Id: RecipeUserId
Optional tenant Id For Password Policy?: string
Optional user Context?: Record<string, any>
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
Static verify Credentials
Parameters
tenantId: string
email: string
password: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "WRONG_CREDENTIALS_ERROR" }>
Generated using TypeDoc
Parameters
tenantId: string
userId: string
email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static reset Password Using Token
Parameters
tenantId: string
token: string
newPassword: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
Static send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: Record<string, any> }
Returns Promise<void>
Static send Reset Password Email
Parameters
tenantId: string
userId: string
email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
Static sign In
Parameters
tenantId: string
email: string
password: string
Optional session: undefined
Optional userContext: Record<string, any>
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Parameters
tenantId: string
email: string
password: string
session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | { reason: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "EMAIL_VERIFICATION_REQUIRED" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED" }>
Static sign Up
Parameters
tenantId: string
email: string
password: string
Optional session: undefined
Optional userContext: Record<string, any>
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Parameters
tenantId: string
email: string
password: string
session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "EMAIL_VERIFICATION_REQUIRED" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED" }>
Static update Email Or Password
Parameters
input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: Record<string, any> }
Optional apply Password Policy?: boolean
Optional email?: string
Optional password?: string
recipe User Id: RecipeUserId
Optional tenant Id For Password Policy?: string
Optional user Context?: Record<string, any>
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
Static verify Credentials
Parameters
tenantId: string
email: string
password: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "WRONG_CREDENTIALS_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Email Verification Claim
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static create Email Verification Link
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static create Email Verification Token
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static is Email Verified
Parameters
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static revoke Email Verification Tokens
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: string }>
Static send Email
Parameters
input: TypeEmailVerificationEmailDeliveryInput & { userContext?: Record<string, any> }
Returns Promise<void>
Static send Email Verification Email
Parameters
tenantId: string
userId: string
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static unverify Email
Parameters
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: string }>
Static verify Email Using Token
Parameters
tenantId: string
token: string
attemptAccountLinking: boolean = true
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Email Verification Claim
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static create Email Verification Link
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static create Email Verification Token
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static is Email Verified
Parameters
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static revoke Email Verification Tokens
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: string }>
Static send Email
Parameters
input: TypeEmailVerificationEmailDeliveryInput & { userContext?: Record<string, any> }
Returns Promise<void>
Static send Email Verification Email
Parameters
tenantId: string
userId: string
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static unverify Email
Parameters
recipeUserId: RecipeUserId
Optional email: string
Optional userContext: Record<string, any>
Returns Promise<{ status: string }>
Static verify Email Using Token
Parameters
tenantId: string
token: string
attemptAccountLinking: boolean = true
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static createJWT
Parameters
payload: any
Optional validitySeconds: number
Optional useStaticSigningKey: boolean
Optional userContext: Record<string, any>
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static createJWT
Parameters
payload: any
Optional validitySeconds: number
Optional useStaticSigningKey: boolean
Optional userContext: Record<string, any>
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Factor Ids
Type declaration
EMAILPASSWORD: string
LINK_ EMAIL: string
LINK_ PHONE: string
OTP_ EMAIL: string
OTP_ PHONE: string
THIRDPARTY: string
TOTP: string
Static Multi Factor Auth Claim
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static add To Required Secondary Factors For User
Parameters
userId: string
factorId: string
Optional userContext: Record<string, any>
Returns Promise<void>
Static assert Allowed To Setup Factor Else Throw Invalid Claim Error
Parameters
session: SessionContainer
factorId: string
Optional userContext: Record<string, any>
Returns Promise<void>
Static get Factors Setup For User
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static getMFARequirements For Auth
Parameters
session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<MFARequirementList>
Static get Required Secondary Factors For User
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static mark Factor As Complete In Session
Parameters
session: SessionContainer
factorId: string
Optional userContext: Record<string, any>
Returns Promise<void>
Static remove From Required Secondary Factors For User
Parameters
userId: string
factorId: string
Optional userContext: Record<string, any>
Returns Promise<void>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Factor Ids
Type declaration
EMAILPASSWORD: string
LINK_ EMAIL: string
LINK_ PHONE: string
OTP_ EMAIL: string
OTP_ PHONE: string
THIRDPARTY: string
TOTP: string
Static Multi Factor Auth Claim
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static add To Required Secondary Factors For User
Parameters
userId: string
factorId: string
Optional userContext: Record<string, any>
Returns Promise<void>
Static assert Allowed To Setup Factor Else Throw Invalid Claim Error
Parameters
session: SessionContainer
factorId: string
Optional userContext: Record<string, any>
Returns Promise<void>
Static get Factors Setup For User
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static getMFARequirements For Auth
Parameters
session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<MFARequirementList>
Static get Required Secondary Factors For User
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static mark Factor As Complete In Session
Parameters
session: SessionContainer
factorId: string
Optional userContext: Record<string, any>
Returns Promise<void>
Static remove From Required Secondary Factors For User
Parameters
userId: string
factorId: string
Optional userContext: Record<string, any>
Returns Promise<void>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static associate User To Tenant
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
Static create Or Update Tenant
Parameters
tenantId: string
Optional config: { coreConfig?: {}; firstFactors?: null | string[]; requiredSecondaryFactors?: null | string[] }
Optional core Config?: {}
[key: string]: any
Optional first Factors?: null | string[]
Optional required Secondary Factors?: null | string[]
Optional userContext: Record<string, any>
Returns Promise<{ createdNew: boolean; status: "OK" }>
Static create Or Update Third Party Config
Parameters
tenantId: string
config: ProviderConfig
Optional skipValidation: boolean
Optional userContext: Record<string, any>
Returns Promise<{ createdNew: boolean; status: "OK" }>
Static delete Tenant
Parameters
tenantId: string
Optional userContext: Record<string, any>
Returns Promise<{ didExist: boolean; status: "OK" }>
Static delete Third Party Config
Parameters
tenantId: string
thirdPartyId: string
Optional userContext: Record<string, any>
Returns Promise<{ didConfigExist: boolean; status: "OK" }>
Static disassociate User From Tenant
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasAssociated: boolean }>
Static get Tenant
Parameters
tenantId: string
Optional userContext: Record<string, any>
Returns Promise<undefined | { status: "OK" } & TenantConfig>
Static list All Tenants
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; tenants: ({ tenantId: string } & TenantConfig)[] }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static associate User To Tenant
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
Static create Or Update Tenant
Parameters
tenantId: string
Optional config: { coreConfig?: {}; firstFactors?: null | string[]; requiredSecondaryFactors?: null | string[] }
Optional core Config?: {}
[key: string]: any
Optional first Factors?: null | string[]
Optional required Secondary Factors?: null | string[]
Optional userContext: Record<string, any>
Returns Promise<{ createdNew: boolean; status: "OK" }>
Static create Or Update Third Party Config
Parameters
tenantId: string
config: ProviderConfig
Optional skipValidation: boolean
Optional userContext: Record<string, any>
Returns Promise<{ createdNew: boolean; status: "OK" }>
Static delete Tenant
Parameters
tenantId: string
Optional userContext: Record<string, any>
Returns Promise<{ didExist: boolean; status: "OK" }>
Static delete Third Party Config
Parameters
tenantId: string
thirdPartyId: string
Optional userContext: Record<string, any>
Returns Promise<{ didConfigExist: boolean; status: "OK" }>
Static disassociate User From Tenant
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasAssociated: boolean }>
Static get Tenant
Parameters
tenantId: string
Optional userContext: Record<string, any>
Returns Promise<undefined | { status: "OK" } & TenantConfig>
Static list All Tenants
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; tenants: ({ tenantId: string } & TenantConfig)[] }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static createJWT
Parameters
Optional payload: any
Optional validitySeconds: number
Optional useStaticSigningKey: boolean
Optional userContext: Record<string, any>
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
Static get Open Id Discovery Configuration
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static createJWT
Parameters
Optional payload: any
Optional validitySeconds: number
Optional useStaticSigningKey: boolean
Optional userContext: Record<string, any>
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
Static get Open Id Discovery Configuration
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static check Code
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static check Code
This function will only verify the code (not consume it), and: NOT create a new user if it doesn't exist NOT verify the user email if it exists NOT do any linking NOT delete the code unless it returned RESTART_FLOW_ERROR
-Parameters
input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string }; status: "OK" } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
Static consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string }; status: "OK" } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
Static consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; session?: undefined; tenantId: string; userContext?: Record<string, any>; userInputCode: string } | { linkCode: string; preAuthSessionId: string; session?: undefined; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
Parameters
input: { deviceId: string; preAuthSessionId: string; session: SessionContainer; tenantId: string; userContext?: Record<string, any>; userInputCode: string } | { linkCode: string; preAuthSessionId: string; session: SessionContainer; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "EMAIL_VERIFICATION_REQUIRED" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED" }>
Static create Code
Parameters
input: { email: string } & { session?: SessionContainer; tenantId: string; userContext?: Record<string, any>; userInputCode?: string } & { phoneNumber: string } & { session?: SessionContainer; tenantId: string; userContext?: Record<string, any>; userInputCode?: string }
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
Static create Magic Link
Parameters
input: { email: string; tenantId: string; userContext?: Record<string, any> } | { phoneNumber: string; tenantId: string; userContext?: Record<string, any> }
Returns Promise<string>
Static create New Code For Device
Parameters
input: { deviceId: string; tenantId: string; userContext?: Record<string, any>; userInputCode?: string }
device Id: string
tenant Id: string
Optional user Context?: Record<string, any>
Optional user Input Code?: string
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
Static list Codes By Device Id
Parameters
input: { deviceId: string; tenantId: string; userContext?: Record<string, any> }
device Id: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<undefined | DeviceType>
Static list Codes By Email
Parameters
input: { email: string; tenantId: string; userContext?: Record<string, any> }
email: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<DeviceType[]>
Static list Codes By Phone Number
Parameters
input: { phoneNumber: string; tenantId: string; userContext?: Record<string, any> }
phone Number: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<DeviceType[]>
Static list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; tenantId: string; userContext?: Record<string, any> }
pre Auth Session Id: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<undefined | DeviceType>
Static revoke All Codes
Parameters
input: { email: string; tenantId: string; userContext?: Record<string, any> } | { phoneNumber: string; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ status: "OK" }>
Static revoke Code
Parameters
input: { codeId: string; tenantId: string; userContext?: Record<string, any> } | { preAuthSessionId: string; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ status: "OK" }>
Static send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: Record<string, any> }
Returns Promise<void>
Static send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: Record<string, any> }
Returns Promise<void>
Static sign In Up
Parameters
input: { email: string; session?: SessionContainer; tenantId: string; userContext?: Record<string, any> } | { phoneNumber: string; session?: SessionContainer; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
Static update User
Parameters
input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: Record<string, any> }
Optional email?: null | string
Optional phone Number?: null | string
recipe User Id: RecipeUserId
Optional user Context?: Record<string, any>
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
Generated using TypeDoc
Parameters
input: { deviceId: string; preAuthSessionId: string; session?: undefined; tenantId: string; userContext?: Record<string, any>; userInputCode: string } | { linkCode: string; preAuthSessionId: string; session?: undefined; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
Parameters
input: { deviceId: string; preAuthSessionId: string; session: SessionContainer; tenantId: string; userContext?: Record<string, any>; userInputCode: string } | { linkCode: string; preAuthSessionId: string; session: SessionContainer; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "EMAIL_VERIFICATION_REQUIRED" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED" }>
Static create Code
Parameters
input: { email: string } & { session?: SessionContainer; tenantId: string; userContext?: Record<string, any>; userInputCode?: string } & { phoneNumber: string } & { session?: SessionContainer; tenantId: string; userContext?: Record<string, any>; userInputCode?: string }
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
Static create Magic Link
Parameters
input: { email: string; tenantId: string; userContext?: Record<string, any> } | { phoneNumber: string; tenantId: string; userContext?: Record<string, any> }
Returns Promise<string>
Static create New Code For Device
Parameters
input: { deviceId: string; tenantId: string; userContext?: Record<string, any>; userInputCode?: string }
device Id: string
tenant Id: string
Optional user Context?: Record<string, any>
Optional user Input Code?: string
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
Static list Codes By Device Id
Parameters
input: { deviceId: string; tenantId: string; userContext?: Record<string, any> }
device Id: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<undefined | DeviceType>
Static list Codes By Email
Parameters
input: { email: string; tenantId: string; userContext?: Record<string, any> }
email: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<DeviceType[]>
Static list Codes By Phone Number
Parameters
input: { phoneNumber: string; tenantId: string; userContext?: Record<string, any> }
phone Number: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<DeviceType[]>
Static list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; tenantId: string; userContext?: Record<string, any> }
pre Auth Session Id: string
tenant Id: string
Optional user Context?: Record<string, any>
Returns Promise<undefined | DeviceType>
Static revoke All Codes
Parameters
input: { email: string; tenantId: string; userContext?: Record<string, any> } | { phoneNumber: string; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ status: "OK" }>
Static revoke Code
Parameters
input: { codeId: string; tenantId: string; userContext?: Record<string, any> } | { preAuthSessionId: string; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ status: "OK" }>
Static send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: Record<string, any> }
Returns Promise<void>
Static send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: Record<string, any> }
Returns Promise<void>
Static sign In Up
Parameters
input: { email: string; session?: SessionContainer; tenantId: string; userContext?: Record<string, any> } | { phoneNumber: string; session?: SessionContainer; tenantId: string; userContext?: Record<string, any> }
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
Static update User
Parameters
input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: Record<string, any> }
Optional email?: null | string
Optional phone Number?: null | string
recipe User Id: RecipeUserId
Optional user Context?: Record<string, any>
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static createJWT
Parameters
Optional payload: any
Optional validitySeconds: number
Optional useStaticSigningKey: boolean
Optional userContext: Record<string, any>
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static create New Session
Parameters
req: any
res: any
tenantId: string
recipeUserId: RecipeUserId
accessTokenPayload: any = {}
sessionDataInDatabase: any = {}
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Static create New Session Without Request Response
Parameters
tenantId: string
recipeUserId: RecipeUserId
accessTokenPayload: any = {}
sessionDataInDatabase: any = {}
disableAntiCsrf: boolean = false
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Static fetch And Set Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static get All Session Handles For User
Parameters
userId: string
fetchSessionsForAllLinkedAccounts: boolean = true
Optional tenantId: string
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static get Claim Value
Type Parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
Optional userContext: Record<string, any>
Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
Static getJWKS
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ keys: JsonWebKey[] }>
Static get Open Id Discovery Configuration
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
Static get Session
Parameters
req: any
res: any
Returns Promise<SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions & { sessionRequired?: true }
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions & { sessionRequired: false }
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionContainer>
Static get Session Information
Parameters
sessionHandle: string
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionInformation>
Static get Session Without Request Response
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static createJWT
Parameters
Optional payload: any
Optional validitySeconds: number
Optional useStaticSigningKey: boolean
Optional userContext: Record<string, any>
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static create New Session
Parameters
req: any
res: any
tenantId: string
recipeUserId: RecipeUserId
accessTokenPayload: any = {}
sessionDataInDatabase: any = {}
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Static create New Session Without Request Response
Parameters
tenantId: string
recipeUserId: RecipeUserId
accessTokenPayload: any = {}
sessionDataInDatabase: any = {}
disableAntiCsrf: boolean = false
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Static fetch And Set Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static get All Session Handles For User
Parameters
userId: string
fetchSessionsForAllLinkedAccounts: boolean = true
Optional tenantId: string
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static get Claim Value
Type Parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
Optional userContext: Record<string, any>
Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
Static getJWKS
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ keys: JsonWebKey[] }>
Static get Open Id Discovery Configuration
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
Static get Session
Parameters
req: any
res: any
Returns Promise<SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions & { sessionRequired?: true }
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions & { sessionRequired: false }
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionContainer>
Static get Session Information
Parameters
sessionHandle: string
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionInformation>
Static get Session Without Request Response
Tries to validate an access token and build a Session object from it.
Notes about anti-csrf checking:
@@ -16,4 +16,4 @@
The access token extracted from the authorization header or cookies
Optional antiCsrfToken: string
The anti-csrf token extracted from the authorization header or cookies. Can be undefined if antiCsrfCheck is false
-Returns Promise<SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions & { sessionRequired?: true }
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions & { sessionRequired: false }
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionContainer>
Static merge Into Access Token Payload
Parameters
sessionHandle: string
accessTokenPayloadUpdate: JSONObject
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static refresh Session
Parameters
req: any
res: any
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Static refresh Session Without Request Response
Parameters
refreshToken: string
disableAntiCsrf: boolean = false
Optional antiCsrfToken: string
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Static remove Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static revoke All Sessions For User
Parameters
userId: string
revokeSessionsForLinkedAccounts: boolean = true
Optional tenantId: string
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static revoke Multiple Sessions
Parameters
sessionHandles: string[]
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static revoke Session
Parameters
sessionHandle: string
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static set Claim Value
Type Parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
value: T
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static update Session Data In Database
Parameters
sessionHandle: string
newSessionData: any
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static validate Claims For Session Handle
Parameters
sessionHandle: string
Optional overrideGlobalClaimValidators: ((globalClaimValidators: SessionClaimValidator[], sessionInfo: SessionInformation, userContext: UserContext) => SessionClaimValidator[] | Promise<SessionClaimValidator[]>)
Parameters
globalClaimValidators: SessionClaimValidator[]
sessionInfo: SessionInformation
userContext: UserContext
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Optional userContext: Record<string, any>
Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { invalidClaims: ClaimValidationError[]; status: "OK" }>
Generated using TypeDoc
Returns Promise<SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions & { sessionRequired?: true }
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions & { sessionRequired: false }
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions
Optional userContext: Record<string, any>
Returns Promise<undefined | SessionContainer>
Static merge Into Access Token Payload
Parameters
sessionHandle: string
accessTokenPayloadUpdate: JSONObject
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static refresh Session
Parameters
req: any
res: any
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Static refresh Session Without Request Response
Parameters
refreshToken: string
disableAntiCsrf: boolean = false
Optional antiCsrfToken: string
Optional userContext: Record<string, any>
Returns Promise<SessionContainer>
Static remove Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static revoke All Sessions For User
Parameters
userId: string
revokeSessionsForLinkedAccounts: boolean = true
Optional tenantId: string
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static revoke Multiple Sessions
Parameters
sessionHandles: string[]
Optional userContext: Record<string, any>
Returns Promise<string[]>
Static revoke Session
Parameters
sessionHandle: string
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static set Claim Value
Type Parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
value: T
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static update Session Data In Database
Parameters
sessionHandle: string
newSessionData: any
Optional userContext: Record<string, any>
Returns Promise<boolean>
Static validate Claims For Session Handle
Parameters
sessionHandle: string
Optional overrideGlobalClaimValidators: ((globalClaimValidators: SessionClaimValidator[], sessionInfo: SessionInformation, userContext: UserContext) => SessionClaimValidator[] | Promise<SessionClaimValidator[]>)
Parameters
globalClaimValidators: SessionClaimValidator[]
sessionInfo: SessionInformation
userContext: UserContext
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Optional userContext: Record<string, any>
Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { invalidClaims: ClaimValidationError[]; status: "OK" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static get Provider
Parameters
tenantId: string
thirdPartyId: string
clientType: undefined | string
Optional userContext: Record<string, any>
Returns Promise<undefined | TypeProvider>
Static manually Create Or Update User
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
Optional session: undefined
Optional userContext: Record<string, any>
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | { reason: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "EMAIL_VERIFICATION_REQUIRED" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static get Provider
Parameters
tenantId: string
thirdPartyId: string
clientType: undefined | string
Optional userContext: Record<string, any>
Returns Promise<undefined | TypeProvider>
Static manually Create Or Update User
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
Optional session: undefined
Optional userContext: Record<string, any>
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
session: SessionContainer
Optional userContext: Record<string, any>
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | { reason: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" | "EMAIL_VERIFICATION_REQUIRED" | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; status: "LINKING_TO_SESSION_USER_FAILED" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static create Device
Parameters
userId: string
Optional userIdentifierInfo: string
Optional deviceName: string
Optional skew: number
Optional period: number
Optional userContext: Record<string, any>
Returns Promise<{ deviceName: string; qrCodeString: string; secret: string; status: "OK" } | { status: "DEVICE_ALREADY_EXISTS_ERROR" } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static list Devices
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<{ devices: { name: string; period: number; skew: number; verified: boolean }[]; status: "OK" }>
Static remove Device
Parameters
userId: string
deviceName: string
Optional userContext: Record<string, any>
Returns Promise<{ didDeviceExist: boolean; status: "OK" }>
Static update Device
Parameters
userId: string
existingDeviceName: string
newDeviceName: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "DEVICE_ALREADY_EXISTS_ERROR" | "UNKNOWN_DEVICE_ERROR" }>
Static verify Device
Parameters
tenantId: string
userId: string
deviceName: string
totp: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasAlreadyVerified: boolean } | { status: "UNKNOWN_DEVICE_ERROR" } | { currentNumberOfFailedAttempts: number; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
Static verifyTOTP
Parameters
tenantId: string
userId: string
totp: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" } | { currentNumberOfFailedAttempts: number; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static create Device
Parameters
userId: string
Optional userIdentifierInfo: string
Optional deviceName: string
Optional skew: number
Optional period: number
Optional userContext: Record<string, any>
Returns Promise<{ deviceName: string; qrCodeString: string; secret: string; status: "OK" } | { status: "DEVICE_ALREADY_EXISTS_ERROR" } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static list Devices
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<{ devices: { name: string; period: number; skew: number; verified: boolean }[]; status: "OK" }>
Static remove Device
Parameters
userId: string
deviceName: string
Optional userContext: Record<string, any>
Returns Promise<{ didDeviceExist: boolean; status: "OK" }>
Static update Device
Parameters
userId: string
existingDeviceName: string
newDeviceName: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "DEVICE_ALREADY_EXISTS_ERROR" | "UNKNOWN_DEVICE_ERROR" }>
Static verify Device
Parameters
tenantId: string
userId: string
deviceName: string
totp: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; wasAlreadyVerified: boolean } | { status: "UNKNOWN_DEVICE_ERROR" } | { currentNumberOfFailedAttempts: number; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
Static verifyTOTP
Parameters
tenantId: string
userId: string
totp: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" } | { currentNumberOfFailedAttempts: number; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static clear User Metadata
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" }>
Static get User Metadata
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<{ metadata: any; status: "OK" }>
Static update User Metadata
Parameters
userId: string
metadataUpdate: JSONObject
Optional userContext: Record<string, any>
Returns Promise<{ metadata: JSONObject; status: "OK" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static clear User Metadata
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" }>
Static get User Metadata
Parameters
userId: string
Optional userContext: Record<string, any>
Returns Promise<{ metadata: any; status: "OK" }>
Static update User Metadata
Parameters
userId: string
metadataUpdate: JSONObject
Optional userContext: Record<string, any>
Returns Promise<{ metadata: JSONObject; status: "OK" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Permission Claim
Static User Role Claim
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static add Role To User
Parameters
tenantId: string
userId: string
role: string
Optional userContext: Record<string, any>
Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static create New Role Or Add Permissions
Parameters
role: string
permissions: string[]
Optional userContext: Record<string, any>
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
Static delete Role
Parameters
role: string
Optional userContext: Record<string, any>
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
Static get All Roles
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Permissions For Role
Parameters
role: string
Optional userContext: Record<string, any>
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static get Roles For User
Parameters
tenantId: string
userId: string
Optional userContext: Record<string, any>
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Roles That Have Permission
Parameters
permission: string
Optional userContext: Record<string, any>
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Users That Have Role
Parameters
tenantId: string
role: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
Static remove Permissions From Role
Parameters
role: string
permissions: string[]
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
Static remove User Role
Parameters
tenantId: string
userId: string
role: string
Optional userContext: Record<string, any>
Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Permission Claim
Static User Role Claim
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static add Role To User
Parameters
tenantId: string
userId: string
role: string
Optional userContext: Record<string, any>
Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static create New Role Or Add Permissions
Parameters
role: string
permissions: string[]
Optional userContext: Record<string, any>
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
Static delete Role
Parameters
role: string
Optional userContext: Record<string, any>
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
Static get All Roles
Parameters
Optional userContext: Record<string, any>
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Permissions For Role
Parameters
role: string
Optional userContext: Record<string, any>
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static get Roles For User
Parameters
tenantId: string
userId: string
Optional userContext: Record<string, any>
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Roles That Have Permission
Parameters
permission: string
Optional userContext: Record<string, any>
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Users That Have Role
Parameters
tenantId: string
role: string
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
Static remove Permissions From Role
Parameters
role: string
permissions: string[]
Optional userContext: Record<string, any>
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
Static remove User Role
Parameters
tenantId: string
userId: string
role: string
Optional userContext: Record<string, any>
Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeInterface SessionEvent
Hierarchy
Index
Properties
Properties
body
headers
http Method
is Base64 Encoded
multi Value Headers
multi Value Query String Parameters
path
path Parameters
query String Parameters
request Context
resource
Optional session
stage Variables
supertokens
Type declaration
response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
cookies: string[]
headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeInterface SessionEvent
Hierarchy
Index
Properties
Properties
body
headers
http Method
is Base64 Encoded
multi Value Headers
multi Value Query String Parameters
path
path Parameters
query String Parameters
request Context
resource
Optional session
stage Variables
supertokens
Type declaration
response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
cookies: string[]
headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeInterface SessionEventV2
Hierarchy
Index
Properties
Properties
Optional body
Optional cookies
headers
is Base64 Encoded
Optional path Parameters
Optional query String Parameters
raw Path
raw Query String
request Context
Type declaration
account Id: string
api Id: string
Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
jwt: { claims: {}; scopes: string[] }
claims: {}
[name: string]: string | number | boolean | string[]
scopes: string[]
domain Name: string
domain Prefix: string
http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
method: string
path: string
protocol: string
source Ip: string
user Agent: string
request Id: string
route Key: string
stage: string
time: string
time Epoch: number
route Key
Optional session
Optional stage Variables
supertokens
Type declaration
response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
cookies: string[]
headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
version
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeInterface SessionEventV2
Hierarchy
Index
Properties
Properties
Optional body
Optional cookies
headers
is Base64 Encoded
Optional path Parameters
Optional query String Parameters
raw Path
raw Query String
request Context
Type declaration
account Id: string
api Id: string
Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
jwt: { claims: {}; scopes: string[] }
claims: {}
[name: string]: string | number | boolean | string[]
scopes: string[]
domain Name: string
domain Prefix: string
http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
method: string
path: string
protocol: string
source Ip: string
user Agent: string
request Id: string
route Key: string
stage: string
time: string
time Epoch: number
route Key
Optional session
Optional stage Variables
supertokens
Type declaration
response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
cookies: string[]
headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
version
Generated using TypeDoc