diff --git a/docs/classes/framework.BaseRequest.html b/docs/classes/framework.BaseRequest.html index 28f4f06c3..a4123793d 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.
Generated using TypeDoc
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 857e09f6f..21eda9171 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 8f2578593..43601d907 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 9a934f3a2..c164d440f 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
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
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>
get Header Value
Parameters
key: string
Returns undefined | string
getJSONBody
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>
get Header Value
Parameters
key: string
Returns undefined | string
getJSONBody
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 }
external User Id: string
Optional external User Id Info?: string
Optional force?: boolean
super Tokens User Id: string
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: any
Returns Promise<{ status: "OK" }>
Static delete User Id Mapping
Parameters
input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional force?: boolean
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: any
Returns undefined | BaseRequest
Static get User
Parameters
userId: string
Optional userContext: any
Returns Promise<undefined | User>
Static get User Count
Parameters
Optional includeRecipeIds: string[]
Optional tenantId: string
Returns Promise<number>
Static get User Id Mapping
Parameters
input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "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 }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Optional query?: {}
[key: string]: string
tenant Id: string
Returns Promise<{ nextPaginationToken?: string; users: User[] }>
Static get Users Oldest First
Parameters
input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Optional query?: {}
[key: string]: string
tenant Id: string
Returns Promise<{ nextPaginationToken?: string; users: User[] }>
Static list Users By Account Info
Parameters
tenantId: string
accountInfo: AccountInfo
doUnionOfAccountInfo: boolean = false
Optional userContext: any
Returns Promise<User[]>
Static update Or Delete User Id Mapping Info
Parameters
input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional external User Id Info?: string
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 }
external User Id: string
Optional external User Id Info?: string
Optional force?: boolean
super Tokens User Id: string
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: any
Returns Promise<{ status: "OK" }>
Static delete User Id Mapping
Parameters
input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional force?: boolean
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: any
Returns undefined | BaseRequest
Static get User
Parameters
userId: string
Optional userContext: any
Returns Promise<undefined | User>
Static get User Count
Parameters
Optional includeRecipeIds: string[]
Optional tenantId: string
Returns Promise<number>
Static get User Id Mapping
Parameters
input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "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 }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Optional query?: {}
[key: string]: string
tenant Id: string
Returns Promise<{ nextPaginationToken?: string; users: User[] }>
Static get Users Oldest First
Parameters
input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Optional query?: {}
[key: string]: string
tenant Id: string
Returns Promise<{ nextPaginationToken?: string; users: User[] }>
Static list Users By Account Info
Parameters
tenantId: string
accountInfo: AccountInfo
doUnionOfAccountInfo: boolean = false
Optional userContext: any
Returns Promise<User[]>
Static update Or Delete User Id Mapping Info
Parameters
input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional external User Id Info?: string
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
userContext: 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
userContext: 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
userContext: 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
userContext: 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
userContext: 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
userContext: 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
userContext: any = {}
Returns Promise<User>
Static get Primary User That Can Be Linked To Recipe User Id
Parameters
tenantId: string
recipeUserId: RecipeUserId
userContext: 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
userContext: any = {}
Returns Promise<undefined | User>
Static is Email Change Allowed
Parameters
recipeUserId: RecipeUserId
newEmail: string
isVerified: boolean
Optional userContext: any
Returns Promise<boolean>
Static is Sign In Allowed
Parameters
tenantId: string
recipeUserId: RecipeUserId
userContext: any = {}
Returns Promise<boolean>
Static is Sign Up Allowed
Parameters
tenantId: string
newUser: AccountInfoWithRecipeId
isVerified: boolean
Optional userContext: any
Returns Promise<boolean>
Static link Accounts
Parameters
recipeUserId: RecipeUserId
primaryUserId: string
userContext: 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
userContext: any = {}
Returns Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>
Generated using TypeDoc
Parameters
tenantId: string
recipeUserId: RecipeUserId
userContext: any = {}
Returns Promise<undefined | User>
Static is Email Change Allowed
Parameters
recipeUserId: RecipeUserId
newEmail: string
isVerified: boolean
Optional userContext: any
Returns Promise<boolean>
Static is Sign In Allowed
Parameters
tenantId: string
recipeUserId: RecipeUserId
userContext: any = {}
Returns Promise<boolean>
Static is Sign Up Allowed
Parameters
tenantId: string
newUser: AccountInfoWithRecipeId
isVerified: boolean
Optional userContext: any
Returns Promise<boolean>
Static link Accounts
Parameters
recipeUserId: RecipeUserId
primaryUserId: string
userContext: 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
userContext: 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: 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
userContext: 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: 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
userContext: 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: 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: any
Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { 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 send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Reset Password Email
Parameters
tenantId: string
userId: string
email: string
userContext: any = {}
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
Static sign In
Parameters
tenantId: string
email: string
password: string
Optional userContext: any
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Static sign Up
Parameters
tenantId: string
email: string
password: string
Optional userContext: any
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Static update Email Or Password
Parameters
input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: 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?: 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" }>
Generated using TypeDoc
Parameters
tenantId: string
userId: string
email: string
Optional userContext: 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: any
Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { 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 send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Reset Password Email
Parameters
tenantId: string
userId: string
email: string
userContext: any = {}
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
Static sign In
Parameters
tenantId: string
email: string
password: string
Optional userContext: any
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Static sign Up
Parameters
tenantId: string
email: string
password: string
Optional userContext: any
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Static update Email Or Password
Parameters
input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: 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?: 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" }>
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
userContext: 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
userContext: any = {}
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static is Email Verified
Parameters
recipeUserId: RecipeUserId
Optional email: string
userContext: any = {}
Returns Promise<boolean>
Static revoke Email Verification Tokens
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional email: string
userContext: any = {}
Returns Promise<{ status: string }>
Static send Email
Parameters
input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Email Verification Email
Parameters
tenantId: string
userId: string
recipeUserId: RecipeUserId
Optional email: string
userContext: any = {}
Returns Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static unverify Email
Parameters
recipeUserId: RecipeUserId
Optional email: string
userContext: any = {}
Returns Promise<{ status: string }>
Static verify Email Using Token
Parameters
tenantId: string
token: string
attemptAccountLinking: boolean = true
userContext: 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
userContext: 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
userContext: any = {}
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static is Email Verified
Parameters
recipeUserId: RecipeUserId
Optional email: string
userContext: any = {}
Returns Promise<boolean>
Static revoke Email Verification Tokens
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional email: string
userContext: any = {}
Returns Promise<{ status: string }>
Static send Email
Parameters
input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Email Verification Email
Parameters
tenantId: string
userId: string
recipeUserId: RecipeUserId
Optional email: string
userContext: any = {}
Returns Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static unverify Email
Parameters
recipeUserId: RecipeUserId
Optional email: string
userContext: any = {}
Returns Promise<{ status: string }>
Static verify Email Using Token
Parameters
tenantId: string
token: string
attemptAccountLinking: boolean = true
userContext: 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: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: 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: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: 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 associate User To Tenant
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: 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?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
Optional core Config?: {}
[key: string]: any
Optional email Password Enabled?: boolean
Optional passwordless Enabled?: boolean
Optional third Party Enabled?: boolean
Optional userContext: any
Returns Promise<{ createdNew: boolean; status: "OK" }>
Static create Or Update Third Party Config
Parameters
tenantId: string
config: ProviderConfig
Optional skipValidation: boolean
Optional userContext: any
Returns Promise<{ createdNew: boolean; status: "OK" }>
Static delete Tenant
Parameters
tenantId: string
Optional userContext: any
Returns Promise<{ didExist: boolean; status: "OK" }>
Static delete Third Party Config
Parameters
tenantId: string
thirdPartyId: string
Optional userContext: any
Returns Promise<{ didConfigExist: boolean; status: "OK" }>
Static disassociate User From Tenant
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: any
Returns Promise<{ status: "OK"; wasAssociated: boolean }>
Static get Tenant
Parameters
tenantId: string
Optional userContext: any
Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
Static list All Tenants
Parameters
Optional userContext: any
Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
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: 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?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
Optional core Config?: {}
[key: string]: any
Optional email Password Enabled?: boolean
Optional passwordless Enabled?: boolean
Optional third Party Enabled?: boolean
Optional userContext: any
Returns Promise<{ createdNew: boolean; status: "OK" }>
Static create Or Update Third Party Config
Parameters
tenantId: string
config: ProviderConfig
Optional skipValidation: boolean
Optional userContext: any
Returns Promise<{ createdNew: boolean; status: "OK" }>
Static delete Tenant
Parameters
tenantId: string
Optional userContext: any
Returns Promise<{ didExist: boolean; status: "OK" }>
Static delete Third Party Config
Parameters
tenantId: string
thirdPartyId: string
Optional userContext: any
Returns Promise<{ didConfigExist: boolean; status: "OK" }>
Static disassociate User From Tenant
Parameters
tenantId: string
recipeUserId: RecipeUserId
Optional userContext: any
Returns Promise<{ status: "OK"; wasAssociated: boolean }>
Static get Tenant
Parameters
tenantId: string
Optional userContext: any
Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
Static list All Tenants
Parameters
Optional userContext: any
Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
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: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
Static get Open Id Discovery Configuration
Parameters
Optional userContext: 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: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
Static get Open Id Discovery Configuration
Parameters
Optional userContext: 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 consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }
Returns Promise<{ 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" }>
Static create Code
Parameters
input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: 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?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<string>
Static create New Code For Device
Parameters
input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
device Id: string
tenant Id: string
Optional user Context?: 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?: any }
device Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
Static list Codes By Email
Parameters
input: { email: string; tenantId: string; userContext?: any }
email: string
tenant Id: string
Optional user Context?: any
Returns Promise<DeviceType[]>
Static list Codes By Phone Number
Parameters
input: { phoneNumber: string; tenantId: string; userContext?: any }
phone Number: string
tenant Id: string
Optional user Context?: any
Returns Promise<DeviceType[]>
Static list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; tenantId: string; userContext?: any }
pre Auth Session Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
Static revoke All Codes
Parameters
input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<{ status: "OK" }>
Static revoke Code
Parameters
input: { codeId: string; tenantId: string; userContext?: any }
code Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<{ status: "OK" }>
Static send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
Static sign In Up
Parameters
input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: 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?: any }
Optional email?: null | string
Optional phone Number?: null | string
recipe User Id: RecipeUserId
Optional user Context?: 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
config: TypeInput
Returns RecipeListFunction
Methods
Static consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }
Returns Promise<{ 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" }>
Static create Code
Parameters
input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: 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?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<string>
Static create New Code For Device
Parameters
input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
device Id: string
tenant Id: string
Optional user Context?: 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?: any }
device Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
Static list Codes By Email
Parameters
input: { email: string; tenantId: string; userContext?: any }
email: string
tenant Id: string
Optional user Context?: any
Returns Promise<DeviceType[]>
Static list Codes By Phone Number
Parameters
input: { phoneNumber: string; tenantId: string; userContext?: any }
phone Number: string
tenant Id: string
Optional user Context?: any
Returns Promise<DeviceType[]>
Static list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; tenantId: string; userContext?: any }
pre Auth Session Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
Static revoke All Codes
Parameters
input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<{ status: "OK" }>
Static revoke Code
Parameters
input: { codeId: string; tenantId: string; userContext?: any }
code Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<{ status: "OK" }>
Static send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
Static sign In Up
Parameters
input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: 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?: any }
Optional email?: null | string
Optional phone Number?: null | string
recipe User Id: RecipeUserId
Optional user Context?: 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
userContext: 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 = {}
userContext: any = {}
Returns Promise<SessionContainer>
Static create New Session Without Request Response
Parameters
tenantId: string
recipeUserId: RecipeUserId
accessTokenPayload: any = {}
sessionDataInDatabase: any = {}
disableAntiCsrf: boolean = false
userContext: any = {}
Returns Promise<SessionContainer>
Static fetch And Set Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
Static get All Session Handles For User
Parameters
userId: string
fetchSessionsForAllLinkedAccounts: boolean = true
Optional tenantId: string
userContext: any = {}
Returns Promise<string[]>
Static get Claim Value
Type parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
userContext: any = {}
Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
Static getJWKS
Parameters
userContext: any = {}
Returns Promise<{ keys: JsonWebKey[] }>
Static get Open Id Discovery Configuration
Parameters
userContext: 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: any
Returns Promise<SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions & { sessionRequired: false }
Optional userContext: any
Returns Promise<undefined | SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions
Optional userContext: any
Returns Promise<undefined | SessionContainer>
Static get Session Information
Parameters
sessionHandle: string
userContext: 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
userContext: 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 = {}
userContext: any = {}
Returns Promise<SessionContainer>
Static create New Session Without Request Response
Parameters
tenantId: string
recipeUserId: RecipeUserId
accessTokenPayload: any = {}
sessionDataInDatabase: any = {}
disableAntiCsrf: boolean = false
userContext: any = {}
Returns Promise<SessionContainer>
Static fetch And Set Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
Static get All Session Handles For User
Parameters
userId: string
fetchSessionsForAllLinkedAccounts: boolean = true
Optional tenantId: string
userContext: any = {}
Returns Promise<string[]>
Static get Claim Value
Type parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
userContext: any = {}
Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
Static getJWKS
Parameters
userContext: any = {}
Returns Promise<{ keys: JsonWebKey[] }>
Static get Open Id Discovery Configuration
Parameters
userContext: 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: any
Returns Promise<SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions & { sessionRequired: false }
Optional userContext: any
Returns Promise<undefined | SessionContainer>
Parameters
req: any
res: any
Optional options: VerifySessionOptions
Optional userContext: any
Returns Promise<undefined | SessionContainer>
Static get Session Information
Parameters
sessionHandle: string
userContext: 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: any
Returns Promise<SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions & { sessionRequired: false }
Optional userContext: any
Returns Promise<undefined | SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions
Optional userContext: any
Returns Promise<undefined | SessionContainer>
Static merge Into Access Token Payload
Parameters
sessionHandle: string
accessTokenPayloadUpdate: JSONObject
userContext: any = {}
Returns Promise<boolean>
Static refresh Session
Parameters
req: any
res: any
userContext: any = {}
Returns Promise<SessionContainer>
Static refresh Session Without Request Response
Parameters
refreshToken: string
disableAntiCsrf: boolean = false
Optional antiCsrfToken: string
userContext: any = {}
Returns Promise<SessionContainer>
Static remove Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
Static revoke All Sessions For User
Parameters
userId: string
revokeSessionsForLinkedAccounts: boolean = true
Optional tenantId: string
userContext: any = {}
Returns Promise<string[]>
Static revoke Multiple Sessions
Parameters
sessionHandles: string[]
userContext: any = {}
Returns Promise<string[]>
Static revoke Session
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<boolean>
Static set Claim Value
Type parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
value: T
userContext: any = {}
Returns Promise<boolean>
Static update Session Data In Database
Parameters
sessionHandle: string
newSessionData: any
userContext: any = {}
Returns Promise<boolean>
Static validate Claims For Session Handle
Parameters
sessionHandle: string
Optional overrideGlobalClaimValidators: (globalClaimValidators: SessionClaimValidator[], sessionInfo: SessionInformation, userContext: any) => SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Parameters
globalClaimValidators: SessionClaimValidator[]
sessionInfo: SessionInformation
userContext: any
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
userContext: 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: any
Returns Promise<SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions & { sessionRequired: false }
Optional userContext: any
Returns Promise<undefined | SessionContainer>
Parameters
accessToken: string
Optional antiCsrfToken: string
Optional options: VerifySessionOptions
Optional userContext: any
Returns Promise<undefined | SessionContainer>
Static merge Into Access Token Payload
Parameters
sessionHandle: string
accessTokenPayloadUpdate: JSONObject
userContext: any = {}
Returns Promise<boolean>
Static refresh Session
Parameters
req: any
res: any
userContext: any = {}
Returns Promise<SessionContainer>
Static refresh Session Without Request Response
Parameters
refreshToken: string
disableAntiCsrf: boolean = false
Optional antiCsrfToken: string
userContext: any = {}
Returns Promise<SessionContainer>
Static remove Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
Static revoke All Sessions For User
Parameters
userId: string
revokeSessionsForLinkedAccounts: boolean = true
Optional tenantId: string
userContext: any = {}
Returns Promise<string[]>
Static revoke Multiple Sessions
Parameters
sessionHandles: string[]
userContext: any = {}
Returns Promise<string[]>
Static revoke Session
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<boolean>
Static set Claim Value
Type parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
value: T
userContext: any = {}
Returns Promise<boolean>
Static update Session Data In Database
Parameters
sessionHandle: string
newSessionData: any
userContext: any = {}
Returns Promise<boolean>
Static validate Claims For Session Handle
Parameters
sessionHandle: string
Optional overrideGlobalClaimValidators: (globalClaimValidators: SessionClaimValidator[], sessionInfo: SessionInformation, userContext: any) => SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Parameters
globalClaimValidators: SessionClaimValidator[]
sessionInfo: SessionInformation
userContext: any
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
userContext: 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
userContext: any = {}
Returns Promise<undefined | TypeProvider>
Static manually Create Or Update User
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
userContext: 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" }>
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
userContext: any = {}
Returns Promise<undefined | TypeProvider>
Static manually Create Or Update User
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
userContext: 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" }>
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
userContext: 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
userContext: any = {}
Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static create Reset Password Token
Parameters
tenantId: string
userId: string
email: string
userContext: any = {}
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static email Password Sign In
Parameters
tenantId: string
email: string
password: string
userContext: any = {}
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Static email Password Sign Up
Parameters
tenantId: string
email: string
password: string
userContext: any = {}
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Static reset Password Using Token
Parameters
tenantId: string
token: string
newPassword: string
Optional userContext: any
Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { 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 send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Reset Password Email
Parameters
tenantId: string
userId: string
email: string
userContext: any = {}
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
Static third Party Get Provider
Parameters
tenantId: string
thirdPartyId: string
clientType: undefined | string
userContext: any = {}
Returns Promise<undefined | TypeProvider>
Static third Party Manually Create Or Update User
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
userContext: 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" }>
Static update Email Or Password
Parameters
input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: 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?: 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" }>
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
userContext: 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
userContext: any = {}
Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static create Reset Password Token
Parameters
tenantId: string
userId: string
email: string
userContext: any = {}
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static email Password Sign In
Parameters
tenantId: string
email: string
password: string
userContext: any = {}
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Static email Password Sign Up
Parameters
tenantId: string
email: string
password: string
userContext: any = {}
Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Static reset Password Using Token
Parameters
tenantId: string
token: string
newPassword: string
Optional userContext: any
Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { 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 send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Reset Password Email
Parameters
tenantId: string
userId: string
email: string
userContext: any = {}
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
Static third Party Get Provider
Parameters
tenantId: string
thirdPartyId: string
clientType: undefined | string
userContext: any = {}
Returns Promise<undefined | TypeProvider>
Static third Party Manually Create Or Update User
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
userContext: 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" }>
Static update Email Or Password
Parameters
input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: 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?: 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" }>
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 consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }
Returns Promise<{ 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" }>
Static create Code
Parameters
input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: 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?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<string>
Static create New Code For Device
Parameters
input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
device Id: string
tenant Id: string
Optional user Context?: 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?: any }
device Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
Static list Codes By Email
Parameters
input: { email: string; tenantId: string; userContext?: any }
email: string
tenant Id: string
Optional user Context?: any
Returns Promise<DeviceType[]>
Static list Codes By Phone Number
Parameters
input: { phoneNumber: string; tenantId: string; userContext?: any }
phone Number: string
tenant Id: string
Optional user Context?: any
Returns Promise<DeviceType[]>
Static list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; tenantId: string; userContext?: any }
pre Auth Session Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
Static passwordless Sign In Up
Parameters
input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
Static revoke All Codes
Parameters
input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<{ status: "OK" }>
Static revoke Code
Parameters
input: { codeId: string; tenantId: string; userContext?: any }
code Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<{ status: "OK" }>
Static send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
Static third Party Get Provider
Parameters
tenantId: string
thirdPartyId: string
clientType: undefined | string
userContext: any = {}
Returns Promise<undefined | TypeProvider>
Static third Party Manually Create Or Update User
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
userContext: 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" }>
Static update Passwordless User
Parameters
input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
Optional email?: null | string
Optional phone Number?: null | string
recipe User Id: RecipeUserId
Optional user Context?: 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
config: TypeInput
Returns RecipeListFunction
Methods
Static consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }
Returns Promise<{ 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" }>
Static create Code
Parameters
input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: 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?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<string>
Static create New Code For Device
Parameters
input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
device Id: string
tenant Id: string
Optional user Context?: 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?: any }
device Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
Static list Codes By Email
Parameters
input: { email: string; tenantId: string; userContext?: any }
email: string
tenant Id: string
Optional user Context?: any
Returns Promise<DeviceType[]>
Static list Codes By Phone Number
Parameters
input: { phoneNumber: string; tenantId: string; userContext?: any }
phone Number: string
tenant Id: string
Optional user Context?: any
Returns Promise<DeviceType[]>
Static list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; tenantId: string; userContext?: any }
pre Auth Session Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
Static passwordless Sign In Up
Parameters
input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
Static revoke All Codes
Parameters
input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }
Returns Promise<{ status: "OK" }>
Static revoke Code
Parameters
input: { codeId: string; tenantId: string; userContext?: any }
code Id: string
tenant Id: string
Optional user Context?: any
Returns Promise<{ status: "OK" }>
Static send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
Static third Party Get Provider
Parameters
tenantId: string
thirdPartyId: string
clientType: undefined | string
userContext: any = {}
Returns Promise<undefined | TypeProvider>
Static third Party Manually Create Or Update User
Parameters
tenantId: string
thirdPartyId: string
thirdPartyUserId: string
email: string
isVerified: boolean
userContext: 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" }>
Static update Passwordless User
Parameters
input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
Optional email?: null | string
Optional phone Number?: null | string
recipe User Id: RecipeUserId
Optional user Context?: 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 init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static clear User Metadata
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK" }>
Static get User Metadata
Parameters
userId: string
Optional userContext: any
Returns Promise<{ metadata: any; status: "OK" }>
Static update User Metadata
Parameters
userId: string
metadataUpdate: JSONObject
Optional userContext: 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: any
Returns Promise<{ status: "OK" }>
Static get User Metadata
Parameters
userId: string
Optional userContext: any
Returns Promise<{ metadata: any; status: "OK" }>
Static update User Metadata
Parameters
userId: string
metadataUpdate: JSONObject
Optional userContext: 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: 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: any
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
Static delete Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
Static get All Roles
Parameters
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Permissions For Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static get Roles For User
Parameters
tenantId: string
userId: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Roles That Have Permission
Parameters
permission: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Users That Have Role
Parameters
tenantId: string
role: string
Optional userContext: any
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
Static remove Permissions From Role
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
Static remove User Role
Parameters
tenantId: string
userId: string
role: string
Optional userContext: 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: 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: any
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
Static delete Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
Static get All Roles
Parameters
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Permissions For Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static get Roles For User
Parameters
tenantId: string
userId: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Roles That Have Permission
Parameters
permission: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get Users That Have Role
Parameters
tenantId: string
role: string
Optional userContext: any
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
Static remove Permissions From Role
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
Static remove User Role
Parameters
tenantId: string
userId: string
role: string
Optional userContext: 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