From 6603c3cd1d5aeb85da6cb8a63ea222c9304550d3 Mon Sep 17 00:00:00 2001
From: rishabhpoddar 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 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 TypeDocClass BaseRequest
Hierarchy
Index
Constructors
constructor
Returns BaseRequest
Properties
Abstract get
Type declaration
Parameters
key_: string
Returns undefined | string
Abstract get
Type declaration
Returns Promise<any>
Abstract get
Type declaration
Parameters
key: string
Returns undefined | string
Abstract getJSONBody
Type declaration
Returns Promise<any>
Abstract get
Type declaration
Parameters
key: string
Returns undefined | string
Abstract get
Type declaration
Returns HTTPMethod
Abstract get
Type declaration
Returns string
original
wrapper
Class BaseRequest
Hierarchy
Index
Constructors
constructor
Returns BaseRequest
Properties
Abstract get
Type declaration
Parameters
key_: string
Returns undefined | string
Abstract get
Type declaration
Returns Promise<any>
Abstract get
Type declaration
Parameters
key: string
Returns undefined | string
Abstract getJSONBody
Type declaration
Returns Promise<any>
Abstract get
Type declaration
Parameters
key: string
Returns undefined | string
Abstract get
Type declaration
Returns HTTPMethod
Abstract get
Type declaration
Returns string
original
wrapper
Class BaseResponse
Hierarchy
Index
Constructors
constructor
Returns BaseResponse
Properties
original
Abstract remove
Type declaration
Parameters
key: string
Returns void
Abstract sendHTMLResponse
Type declaration
Parameters
html: string
Returns void
Abstract sendJSONResponse
Type declaration
Parameters
content: any
Returns void
Abstract set
Type declaration
Parameters
key: string
value: string
domain: undefined | string
secure: boolean
httpOnly: boolean
expires: number
path: string
sameSite: "strict" | "lax" | "none"
Returns void
Abstract set
Type declaration
Parameters
key: string
value: string
allowDuplicateKey: boolean
Returns void
Abstract set
Type declaration
Parameters
statusCode: number
Returns void
wrapper
Class BaseResponse
Hierarchy
Index
Constructors
constructor
Returns BaseResponse
Properties
original
Abstract remove
Type declaration
Parameters
key: string
Returns void
Abstract sendHTMLResponse
Type declaration
Parameters
html: string
Returns void
Abstract sendJSONResponse
Type declaration
Parameters
content: any
Returns void
Abstract set
Type declaration
Parameters
key: string
value: string
domain: undefined | string
secure: boolean
httpOnly: boolean
expires: number
path: string
sameSite: "strict" | "lax" | "none"
Returns void
Abstract set
Type declaration
Parameters
key: string
value: string
allowDuplicateKey: boolean
Returns void
Abstract set
Type declaration
Parameters
statusCode: number
Returns void
wrapper
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns void
Methods
Static create
Parameters
input: { externalUserId: string; externalUserIdInfo?: string; force?: false | true; superTokensUserId: string }
external
Optional external
Optional force?: false | true
super
Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
Static delete
Parameters
userId: string
Returns Promise<{ status: "OK" }>
Static delete
Parameters
input: { force?: false | true; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional force?: false | true
user
Optional user
Returns Promise<{ didMappingExist: boolean; status: "OK" }>
Static get
Returns string[]
Static get
Parameters
Optional includeRecipeIds: string[]
Returns Promise<number>
Static get
Parameters
input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
user
Optional user
Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
Static get
Parameters
Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
Optional include
Optional limit?: number
Optional pagination
Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
Static get
Parameters
Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
Optional include
Optional limit?: number
Optional pagination
Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
Static update
Parameters
input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional external
user
Optional user
Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns void
Methods
Static create
Parameters
input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }
external
Optional external
Optional force?: boolean
super
Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
Static delete
Parameters
userId: string
Returns Promise<{ status: "OK" }>
Static delete
Parameters
input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional force?: boolean
user
Optional user
Returns Promise<{ didMappingExist: boolean; status: "OK" }>
Static get
Returns string[]
Static get
Parameters
Optional includeRecipeIds: string[]
Returns Promise<number>
Static get
Parameters
input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
user
Optional user
Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
Static get
Parameters
Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
Optional include
Optional limit?: number
Optional pagination
Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
Static get
Parameters
Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
Optional include
Optional limit?: number
Optional pagination
Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
Static update
Parameters
input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional external
user
Optional user
Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
Class default<T>
Type parameters
T
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type parameters
T
Parameters
config: TypeInputWithService<T>
Returns default<T>
Properties
ingredient
Class default<T>
Type parameters
T
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type parameters
T
Parameters
config: TypeInputWithService<T>
Returns default<T>
Properties
ingredient
Class default<T>
Type parameters
T
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type parameters
T
Parameters
config: TypeInputWithService<T>
Returns default<T>
Properties
ingredient
Class default<T>
Type parameters
T
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type parameters
T
Parameters
config: TypeInputWithService<T>
Returns default<T>
Properties
ingredient
Class default
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Class default
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static create
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static get
Parameters
email: string
Optional userContext: any
Returns Promise<undefined | User>
Static get
Parameters
userId: string
Optional userContext: any
Returns Promise<undefined | User>
Static reset
Parameters
token: string
newPassword: string
Optional userContext: any
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
Static send
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static sign
Parameters
email: string
password: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Static sign
Parameters
email: string
password: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Static update
Parameters
input: { email?: string; password?: string; userContext?: any; userId: string }
Optional email?: string
Optional password?: string
Optional user
user
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static create
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static get
Parameters
email: string
Optional userContext: any
Returns Promise<undefined | User>
Static get
Parameters
userId: string
Optional userContext: any
Returns Promise<undefined | User>
Static reset
Parameters
token: string
newPassword: string
Optional userContext: any
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
Static send
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static sign
Parameters
email: string
password: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Static sign
Parameters
email: string
password: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Static update
Parameters
input: { email?: string; password?: string; userContext?: any; userId: string }
Optional email?: string
Optional password?: string
Optional user
user
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Email
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static create
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static is
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<boolean>
Static revoke
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: string }>
Static send
Parameters
input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static unverify
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: string }>
Static verify
Parameters
token: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Email
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static create
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
Static is
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<boolean>
Static revoke
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: string }>
Static send
Parameters
input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static unverify
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: string }>
Static verify
Parameters
token: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
Class default
Hierarchy
Index
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 userContext: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
Class default
Hierarchy
Index
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 userContext: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
Class default
Hierarchy
Index
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 userContext: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
Static get
Parameters
Optional userContext: any
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
Class default
Hierarchy
Index
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 userContext: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
Static get
Parameters
Optional userContext: any
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static consume
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; 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
Parameters
input: ({ email: string } & { userContext?: any; userInputCode?: string }) | ({ phoneNumber: 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
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<string>
Static create
Parameters
input: { deviceId: string; userContext?: any; userInputCode?: string }
device
Optional user
Optional user
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 get
Parameters
input: { email: string; userContext?: any }
email: string
Optional user
Returns Promise<undefined | User>
Static get
Parameters
input: { userContext?: any; userId: string }
Optional user
user
Returns Promise<undefined | User>
Static get
Parameters
input: { phoneNumber: string; userContext?: any }
phone
Optional user
Returns Promise<undefined | User>
Static list
Parameters
input: { deviceId: string; userContext?: any }
device
Optional user
Returns Promise<undefined | DeviceType>
Static list
Parameters
input: { email: string; userContext?: any }
email: string
Optional user
Returns Promise<DeviceType[]>
Static list
Parameters
input: { phoneNumber: string; userContext?: any }
phone
Optional user
Returns Promise<DeviceType[]>
Static list
Parameters
input: { preAuthSessionId: string; userContext?: any }
pre
Optional user
Returns Promise<undefined | DeviceType>
Static revoke
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ status: "OK" }>
Static revoke
Parameters
input: { codeId: string; userContext?: any }
code
Optional user
Returns Promise<{ status: "OK" }>
Static send
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
Static sign
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: string; user: User }>
Static update
Parameters
input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
Optional email?: null | string
Optional phone
Optional user
user
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Error
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static consume
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; 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
Parameters
input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: 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
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<string>
Static create
Parameters
input: { deviceId: string; userContext?: any; userInputCode?: string }
device
Optional user
Optional user
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 get
Parameters
input: { email: string; userContext?: any }
email: string
Optional user
Returns Promise<undefined | User>
Static get
Parameters
input: { userContext?: any; userId: string }
Optional user
user
Returns Promise<undefined | User>
Static get
Parameters
input: { phoneNumber: string; userContext?: any }
phone
Optional user
Returns Promise<undefined | User>
Static list
Parameters
input: { deviceId: string; userContext?: any }
device
Optional user
Returns Promise<undefined | DeviceType>
Static list
Parameters
input: { email: string; userContext?: any }
email: string
Optional user
Returns Promise<DeviceType[]>
Static list
Parameters
input: { phoneNumber: string; userContext?: any }
phone
Optional user
Returns Promise<DeviceType[]>
Static list
Parameters
input: { preAuthSessionId: string; userContext?: any }
pre
Optional user
Returns Promise<undefined | DeviceType>
Static revoke
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ status: "OK" }>
Static revoke
Parameters
input: { codeId: string; userContext?: any }
code
Optional user
Returns Promise<{ status: "OK" }>
Static send
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
Static sign
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: string; user: User }>
Static update
Parameters
input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
Optional email?: null | string
Optional phone
Optional user
user
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Class 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
userContext: any = {}
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static create
Parameters
req: any
res: any
userId: string
accessTokenPayload: any = {}
sessionData: any = {}
userContext: any = {}
Returns Promise<SessionContainer>
Static fetch
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
Static get
Parameters
userId: string
userContext: any = {}
Returns Promise<string[]>
Static get
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[]; status: "OK" }>
Static get
Parameters
userContext: any = {}
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
Static get
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>
Static get
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<undefined | SessionInformation>
Static merge
Parameters
sessionHandle: string
accessTokenPayloadUpdate: JSONObject
userContext: any = {}
Returns Promise<boolean>
Static refresh
Parameters
req: any
res: any
userContext: any = {}
Returns Promise<SessionContainer>
Static regenerate
Parameters
accessToken: string
Optional newAccessTokenPayload: any
userContext: any = {}
Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>
Static remove
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
Static revoke
Parameters
userId: string
userContext: any = {}
Returns Promise<string[]>
Static revoke
Parameters
sessionHandles: string[]
userContext: any = {}
Returns Promise<string[]>
Static revoke
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<boolean>
Static set
Type parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
value: T
userContext: any = {}
Returns Promise<boolean>
Static update
Parameters
sessionHandle: string
newAccessTokenPayload: any
userContext: any = {}
Returns Promise<boolean>
Static update
Parameters
sessionHandle: string
newSessionData: any
userContext: any = {}
Returns Promise<boolean>
Static validate
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" }>
Static validate
Parameters
userId: string
jwtPayload: JSONObject
Optional overrideGlobalClaimValidators: (globalClaimValidators: SessionClaimValidator[], userId: string, userContext: any) => SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Parameters
globalClaimValidators: SessionClaimValidator[]
userId: string
userContext: any
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
userContext: any = {}
Returns Promise<{ invalidClaims: ClaimValidationError[]; status: "OK" }>
Class 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
userContext: any = {}
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
Static create
Parameters
req: any
res: any
userId: string
accessTokenPayload: any = {}
sessionData: any = {}
userContext: any = {}
Returns Promise<SessionContainer>
Static fetch
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
Static get
Parameters
userId: string
userContext: any = {}
Returns Promise<string[]>
Static get
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[]; status: "OK" }>
Static get
Parameters
userContext: any = {}
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
Static get
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>
Static get
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<undefined | SessionInformation>
Static merge
Parameters
sessionHandle: string
accessTokenPayloadUpdate: JSONObject
userContext: any = {}
Returns Promise<boolean>
Static refresh
Parameters
req: any
res: any
userContext: any = {}
Returns Promise<SessionContainer>
Static regenerate
Parameters
accessToken: string
Optional newAccessTokenPayload: any
userContext: any = {}
Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>
Static remove
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
Static revoke
Parameters
userId: string
userContext: any = {}
Returns Promise<string[]>
Static revoke
Parameters
sessionHandles: string[]
userContext: any = {}
Returns Promise<string[]>
Static revoke
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<boolean>
Static set
Type parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
value: T
userContext: any = {}
Returns Promise<boolean>
Static update
Parameters
sessionHandle: string
newAccessTokenPayload: any
userContext: any = {}
Returns Promise<boolean>
Static update
Parameters
sessionHandle: string
newSessionData: any
userContext: any = {}
Returns Promise<boolean>
Static validate
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" }>
Static validate
Parameters
userId: string
jwtPayload: JSONObject
Optional overrideGlobalClaimValidators: (globalClaimValidators: SessionClaimValidator[], userId: string, userContext: any) => SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Parameters
globalClaimValidators: SessionClaimValidator[]
userId: string
userContext: any
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
userContext: any = {}
Returns Promise<{ invalidClaims: ClaimValidationError[]; status: "OK" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Apple
Type declaration
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Static Discord
Type declaration
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Static Error
Static Facebook
Type declaration
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Static Github
Type declaration
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static get
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
Static sign
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Apple
Type declaration
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Static Discord
Type declaration
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Static Error
Static Facebook
Type declaration
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Static Github
Type declaration
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static get
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
Static sign
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Apple
Type declaration
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Static Discord
Type declaration
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Static Error
Static Facebook
Type declaration
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Static Github
Type declaration
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static create
Parameters
userId: string
userContext: any = {}
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static email
Parameters
email: string
password: string
userContext: any = {}
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Static email
Parameters
email: string
password: string
userContext: any = {}
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Static get
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
Static reset
Parameters
token: string
newPassword: string
userContext: any = {}
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
Static send
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static third
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Static update
Parameters
input: { email?: string; password?: string; userContext?: any; userId: string }
Optional email?: string
Optional password?: string
Optional user
user
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Apple
Type declaration
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Static Discord
Type declaration
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Static Error
Static Facebook
Type declaration
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Static Github
Type declaration
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static create
Parameters
userId: string
userContext: any = {}
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
Static email
Parameters
email: string
password: string
userContext: any = {}
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
Static email
Parameters
email: string
password: string
userContext: any = {}
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
Static get
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
Static reset
Parameters
token: string
newPassword: string
userContext: any = {}
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
Static send
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static third
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Static update
Parameters
input: { email?: string; password?: string; userContext?: any; userId: string }
Optional email?: string
Optional password?: string
Optional user
user
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
Class default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Apple
Type declaration
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Static Discord
Type declaration
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Static Error
Static Facebook
Type declaration
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Static Github
Type declaration
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static consume
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; 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
Parameters
input: ({ email: string } & { userContext?: any; userInputCode?: string }) | ({ phoneNumber: 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
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<string>
Static create
Parameters
input: { deviceId: string; userContext?: any; userInputCode?: string }
device
Optional user
Optional user
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 get
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
Static get
Parameters
input: { phoneNumber: string; userContext?: any }
phone
Optional user
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
Static get
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
Static get
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
Static list
Parameters
input: { deviceId: string; userContext?: any }
device
Optional user
Returns Promise<undefined | DeviceType>
Static list
Parameters
input: { email: string; userContext?: any }
email: string
Optional user
Returns Promise<DeviceType[]>
Static list
Parameters
input: { phoneNumber: string; userContext?: any }
phone
Optional user
Returns Promise<DeviceType[]>
Static list
Parameters
input: { preAuthSessionId: string; userContext?: any }
pre
Optional user
Returns Promise<undefined | DeviceType>
Static passwordless
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: string; user: User }>
Static revoke
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ status: "OK" }>
Static revoke
Parameters
input: { codeId: string; userContext?: any }
code
Optional user
Returns Promise<{ status: "OK" }>
Static send
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
Static third
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Static update
Parameters
input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
Optional email?: null | string
Optional phone
Optional user
user
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Class default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Apple
Type declaration
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Static Discord
Type declaration
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Static Error
Static Facebook
Type declaration
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Static Github
Type declaration
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Static Google
Type declaration
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
Static init
Type declaration
Parameters
config: TypeInput
Returns RecipeListFunction
Methods
Static consume
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; 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
Parameters
input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: 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
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<string>
Static create
Parameters
input: { deviceId: string; userContext?: any; userInputCode?: string }
device
Optional user
Optional user
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 get
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
input: { phoneNumber: string; userContext?: any }
phone
Optional user
Returns Promise<undefined | User>
Static get
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
Static get
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
Static list
Parameters
input: { deviceId: string; userContext?: any }
device
Optional user
Returns Promise<undefined | DeviceType>
Static list
Parameters
input: { email: string; userContext?: any }
email: string
Optional user
Returns Promise<DeviceType[]>
Static list
Parameters
input: { phoneNumber: string; userContext?: any }
phone
Optional user
Returns Promise<DeviceType[]>
Static list
Parameters
input: { preAuthSessionId: string; userContext?: any }
pre
Optional user
Returns Promise<undefined | DeviceType>
Static passwordless
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: string; user: User }>
Static revoke
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ status: "OK" }>
Static revoke
Parameters
input: { codeId: string; userContext?: any }
code
Optional user
Returns Promise<{ status: "OK" }>
Static send
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
Static send
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
Static third
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Static update
Parameters
input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
Optional email?: null | string
Optional phone
Optional user
user
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static clear
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK" }>
Static get
Parameters
userId: string
Optional userContext: any
Returns Promise<{ metadata: any; status: "OK" }>
Static update
Parameters
userId: string
metadataUpdate: JSONObject
Optional userContext: any
Returns Promise<{ metadata: JSONObject; status: "OK" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static clear
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK" }>
Static get
Parameters
userId: string
Optional userContext: any
Returns Promise<{ metadata: any; status: "OK" }>
Static update
Parameters
userId: string
metadataUpdate: JSONObject
Optional userContext: any
Returns Promise<{ metadata: JSONObject; status: "OK" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Permission
Static User
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static add
Parameters
userId: string
role: string
Optional userContext: any
Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static create
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
Static delete
Parameters
role: string
Optional userContext: any
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
Static get
Parameters
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get
Parameters
role: string
Optional userContext: any
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static get
Parameters
userId: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get
Parameters
permission: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get
Parameters
role: string
Optional userContext: any
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
Static remove
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
Static remove
Parameters
userId: string
role: string
Optional userContext: any
Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Class default
Hierarchy
Index
Constructors
constructor
Returns default
Properties
Static Permission
Static User
Static init
Type declaration
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Methods
Static add
Parameters
userId: string
role: string
Optional userContext: any
Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static create
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
Static delete
Parameters
role: string
Optional userContext: any
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
Static get
Parameters
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get
Parameters
role: string
Optional userContext: any
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Static get
Parameters
userId: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get
Parameters
permission: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
Static get
Parameters
role: string
Optional userContext: any
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
Static remove
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
Static remove
Parameters
userId: string
role: string
Optional userContext: any
Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Interface SessionEvent
Hierarchy
Index
Properties
body
headers
http
is
multi
multi
path
path
query
request
resource
Optional session
stage
supertokens
Type declaration
response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | false | true }[] }
cookies: string[]
headers: { allowDuplicateKey: boolean; key: string; value: string | number | false | true }[]
Interface SessionEvent
Hierarchy
Index
Properties
body
headers
http
is
multi
multi
path
path
query
request
resource
Optional session
stage
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 }[]
Interface SessionEventV2
Hierarchy
Index
Properties
Optional body
Optional cookies
headers
is
Optional path
Optional query
raw
raw
request
Type declaration
account
api
Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
jwt: { claims: {}; scopes: string[] }
claims: {}
[name: string]: string | number | boolean | string[]
scopes: string[]
domain
domain
http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
method: string
path: string
protocol: string
source
user
request
route
stage: string
time: string
time
route
Optional session
Optional stage
supertokens
Type declaration
response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | false | true }[] }
cookies: string[]
headers: { allowDuplicateKey: boolean; key: string; value: string | number | false | true }[]
version
Interface SessionEventV2
Hierarchy
Index
Properties
Optional body
Optional cookies
headers
is
Optional path
Optional query
raw
raw
request
Type declaration
account
api
Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
jwt: { claims: {}; scopes: string[] }
claims: {}
[name: string]: string | number | boolean | string[]
scopes: string[]
domain
domain
http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
method: string
path: string
protocol: string
source
user
request
route
stage: string
time: string
time
route
Optional session
Optional stage
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
accepted
Return an array of Accepted media types ordered from highest quality to lowest.
-app
base Url
body
complete
app
base Url
body
complete
The
message.complete
property will betrue
if a complete HTTP message has been received and successfully parsed.This property is particularly useful as a means of determining if a client or @@ -18,10 +18,10 @@
Alias for
message.socket
.v0.1.90
Since v16.0.0 - Use
-socket
.cookies
destroyed
cookies
destroyed
Is
true
afterreadable.destroy()
has been called.v8.0.0
-fresh
fresh
Check if the request is fresh, aka Last-Modified and/or the ETag still match.
@@ -40,8 +40,8 @@v0.1.5
-host
Use hostname instead.
-hostname
host
Use hostname instead.
+hostname
Parse the "Host" header field hostname.
http Version
In case of server request, the HTTP version sent by the client. In the case of @@ -49,26 +49,26 @@ Probably either
'1.1'
or'1.0'
.Also
message.httpVersionMajor
is the first integer andmessage.httpVersionMinor
is the second.v0.1.1
-http Version Major
http Version Minor
ip
http Version Major
http Version Minor
ip
Return the remote address, or when "trust proxy" is
-true
return the upstream addr.ips
ips
When "trust proxy" is
true
, parse the "X-Forwarded-For" ip address list.For example if the value were "client, proxy1, proxy2" you would receive the array
-["client", "proxy1", "proxy2"]
where "proxy2" is the furthest down-stream.method
Optional next
original Url
params
path
method
Optional next
original Url
params
path
Short-hand for
-url.parse(req.url).pathname
.protocol
protocol
Return the protocol string "http" or "https" when requested with TLS. When the "trust proxy" setting is enabled the "X-Forwarded-Proto" header field will be trusted. If you're running behind a reverse proxy that supplies https for you this may be enabled.
-query
raw Headers
query
raw Headers
The raw request/response headers list exactly as they were received.
The keys and values are in the same list. It is not a list of tuples. So, the even-numbered offsets are key values, and the @@ -91,13 +91,13 @@
Readonly readable Did Read
Returns whether
'data'
has been emitted.v16.7.0, v14.18.0
-Readonly readable Encoding
Readonly readable Encoding
Getter for the property
encoding
of a givenReadable
stream. Theencoding
property can be set using thereadable.setEncoding()
method.v12.7.0
Readonly readable Ended
Becomes
true
when'end'
event is emitted.v12.9.0
-Readonly readable Flowing
Readonly readable Flowing
This property reflects the current state of a
Readable
stream as described in theThree states
section.v9.4.0
@@ -112,13 +112,13 @@Readonly readable Object Mode
Getter for the property
objectMode
of a givenReadable
stream.v12.3.0
-Optional res
Optional res
After middleware.init executed, Request will contain res and next properties See: express/lib/middleware/init.js
-route
secure
route
secure
Short-hand for:
req.protocol == 'https'
-Optional session
signed Cookies
socket
Optional session
signed Cookies
socket
The
net.Socket
object associated with the connection.With HTTPS support, use
@@ -126,7 +126,7 @@ a subclass ofrequest.socket.getPeerCertificate()
to obtain the client's authentication details.stream.Duplex
, unless the user specified a socket type other thannet.Socket
.v0.3.0
-stale
stale
Check if the request is stale, aka "Last-Modified" and / or the "ETag" for the resource has changed.
@@ -138,7 +138,7 @@Only valid for response obtained from {@link ClientRequest}.
The HTTP response status message (reason phrase). E.G.
OK
orInternal Server Error
.v0.11.10
-subdomains
subdomains
Return subdomains as an array.
Subdomains are the dot-separated parts of the host before the main domain of the app. By default, the domain of the app is assumed to be the last two @@ -149,9 +149,9 @@
trailers
The request/response trailers object. Only populated at the
'end'
event.v0.3.0
-url
xhr
url
xhr
Check if the request was an XMLHttpRequest.
-Methods
[ Symbol.async Iterator]
Returns AsyncIterableIterator<any>
Optional _construct
Parameters
callback: (error?: null | Error) => void
Parameters
Optional error: null | Error
Returns void
Returns void
_destroy
Parameters
error: null | Error
callback: (error?: null | Error) => void
Parameters
Optional error: null | Error
Returns void
Returns void
_read
Parameters
size: number
Returns void
accepts
Methods
[ Symbol.async Iterator]
Returns AsyncIterableIterator<any>
Optional _construct
Parameters
callback: (error?: null | Error) => void
Parameters
Optional error: null | Error
Returns void
Returns void
_destroy
Parameters
error: null | Error
callback: (error?: null | Error) => void
Parameters
Optional error: null | Error
Returns void
Returns void
_read
Parameters
size: number
Returns void
accepts
Check if the given
@@ -163,22 +163,22 @@type(s)
is acceptable, returning the best match when true, otherwiseundefined
, in which case you should respond with 406 "Not Acceptable".Examples:
-Returns string[]
Parameters
type: string
Returns string | false
Parameters
type: string[]
Returns string | false
Parameters
Rest ...type: string[]
Returns string | false
accepts Charsets
Returns string[]
Parameters
type: string
Returns string | false
Parameters
type: string[]
Returns string | false
Parameters
Rest ...type: string[]
Returns string | false
accepts Charsets
Returns the first accepted charset of the specified character sets, based on the request's Accept-Charset HTTP header field. If none of the specified charsets is accepted, returns false.
For more information, or if you have issues or concerns, see accepts.
-Returns string[]
Parameters
charset: string
Returns string | false
Parameters
charset: string[]
Returns string | false
Parameters
Rest ...charset: string[]
Returns string | false
accepts Encodings
Returns string[]
Parameters
charset: string
Returns string | false
Parameters
charset: string[]
Returns string | false
Parameters
Rest ...charset: string[]
Returns string | false
accepts Encodings
Returns the first accepted encoding of the specified encodings, based on the request's Accept-Encoding HTTP header field. If none of the specified encodings is accepted, returns false.
For more information, or if you have issues or concerns, see accepts.
-Returns string[]
Parameters
encoding: string
Returns string | false
Parameters
encoding: string[]
Returns string | false
Parameters
Rest ...encoding: string[]
Returns string | false
accepts Languages
Returns string[]
Parameters
encoding: string
Returns string | false
Parameters
encoding: string[]
Returns string | false
Parameters
Rest ...encoding: string[]
Returns string | false
accepts Languages
Returns the first accepted language of the specified languages, based on the request's Accept-Language HTTP header field. If none of the specified languages is accepted, returns false.
For more information, or if you have issues or concerns, see accepts.
-Returns string[]
Parameters
lang: string
Returns string | false
Parameters
lang: string[]
Returns string | false
Parameters
Rest ...lang: string[]
Returns string | false
add Listener
Returns string[]
Parameters
lang: string
Returns string | false
Parameters
lang: string[]
Returns string | false
Parameters
Rest ...lang: string[]
Returns string | false
add Listener
Event emitter The defined events on documents including:
@@ -200,7 +200,7 @@
v6.0.0
-Returns (string | symbol)[]
get
Returns (string | symbol)[]
get
Return request header.
The
@@ -208,17 +208,17 @@Referrer
header field is special-cased, bothReferrer
andReferer
are interchangeable.Aliased as
-req.header()
.Parameters
name: "set-cookie"
Returns undefined | string[]
Parameters
name: string
Returns undefined | string
get Max Listeners
Parameters
name: "set-cookie"
Returns undefined | string[]
Parameters
name: string
Returns undefined | string
get Max Listeners
Returns the current max listener value for the
EventEmitter
which is either set byemitter.setMaxListeners(n)
or defaults to {@link defaultMaxListeners}.v1.0.0
-Returns number
header
Parameters
name: "set-cookie"
Returns undefined | string[]
Parameters
name: string
Returns undefined | string
is
Returns number
header
Parameters
name: "set-cookie"
Returns undefined | string[]
Parameters
name: string
Returns undefined | string
is
Check if the incoming request contains the "Content-Type" header field, and it contains the give mime
type
.Examples:
-Parameters
type: string | string[]
Returns null | string | false
is Paused
Parameters
type: string | string[]
Returns null | string | false
is Paused
The
@@ -238,7 +238,7 @@readable.isPaused()
method returns the current operating state of theReadable
. This is used primarily by the mechanism that underlies thereadable.pipe()
method. In most typical cases, there will be no reason to use this method directly.Parameters
eventName: string | symbol
Returns Function[]
off
Alias for
emitter.removeListener()
.v10.0.0
-Parameters
eventName: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
on
Parameters
event: "close"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "data"
listener: (chunk: any) => void
Parameters
chunk: any
Returns void
Returns SessionRequest
Parameters
event: "end"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "error"
listener: (err: Error) => void
Parameters
err: Error
Returns void
Returns SessionRequest
Parameters
event: "pause"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "readable"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "resume"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
once
Parameters
event: "close"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "data"
listener: (chunk: any) => void
Parameters
chunk: any
Returns void
Returns SessionRequest
Parameters
event: "end"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "error"
listener: (err: Error) => void
Parameters
err: Error
Returns void
Returns SessionRequest
Parameters
event: "pause"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "readable"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "resume"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
param
since 4.11 Use either req.params, req.body or req.query, as applicable.
+Parameters
eventName: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
on
Parameters
event: "close"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "data"
listener: (chunk: any) => void
Parameters
chunk: any
Returns void
Returns SessionRequest
Parameters
event: "end"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "error"
listener: (err: Error) => void
Parameters
err: Error
Returns void
Returns SessionRequest
Parameters
event: "pause"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "readable"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "resume"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
once
Parameters
event: "close"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "data"
listener: (chunk: any) => void
Parameters
chunk: any
Returns void
Returns SessionRequest
Parameters
event: "end"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "error"
listener: (err: Error) => void
Parameters
err: Error
Returns void
Returns SessionRequest
Parameters
event: "pause"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "readable"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "resume"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
param
since 4.11 Use either req.params, req.body or req.query, as applicable.
Return the value of param
name
when present ordefaultValue
.The
readable.pause()
method has no effect if there is a'readable'
event listener.v0.9.4
-Returns SessionRequest
pipe
Type parameters
T: WritableStream<T>
Parameters
destination: T
Optional options: { end?: false | true }
Optional end?: false | true
Returns T
prepend Listener
Parameters
event: "close"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "data"
listener: (chunk: any) => void
Parameters
chunk: any
Returns void
Returns SessionRequest
Parameters
event: "end"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "error"
listener: (err: Error) => void
Parameters
err: Error
Returns void
Returns SessionRequest
Parameters
event: "pause"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "readable"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "resume"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
prepend Once Listener
Parameters
event: "close"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "data"
listener: (chunk: any) => void
Parameters
chunk: any
Returns void
Returns SessionRequest
Parameters
event: "end"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "error"
listener: (err: Error) => void
Parameters
err: Error
Returns void
Returns SessionRequest
Parameters
event: "pause"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "readable"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "resume"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
push
Parameters
chunk: any
Optional encoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"
Returns boolean
range
Returns SessionRequest
pipe
Type parameters
T: WritableStream<T>
Parameters
destination: T
Optional options: { end?: boolean }
Optional end?: boolean
Returns T
prepend Listener
Parameters
event: "close"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "data"
listener: (chunk: any) => void
Parameters
chunk: any
Returns void
Returns SessionRequest
Parameters
event: "end"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "error"
listener: (err: Error) => void
Parameters
err: Error
Returns void
Returns SessionRequest
Parameters
event: "pause"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "readable"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "resume"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
prepend Once Listener
Parameters
event: "close"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "data"
listener: (chunk: any) => void
Parameters
chunk: any
Returns void
Returns SessionRequest
Parameters
event: "end"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "error"
listener: (err: Error) => void
Parameters
err: Error
Returns void
Returns SessionRequest
Parameters
event: "pause"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "readable"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: "resume"
listener: () => void
Returns void
Returns SessionRequest
Parameters
event: string | symbol
listener: (...args: any[]) => void
Parameters
Rest ...args: any[]
Returns void
Returns SessionRequest
push
Parameters
chunk: any
Optional encoding: BufferEncoding
Returns boolean
range
Parse Range header field, capping to the given
size
.Unspecified ranges such as "0-" require knowledge of your resource length. In the case of a byte range this is of course the total number of bytes. @@ -265,7 +265,7 @@ See more ./types/range-parser/index.d.ts
NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" should respond with 4 users when available, not 3.
-Parameters
size: number
Optional options: Options
Returns undefined | Ranges | -1 | -2
raw Listeners
Parameters
size: number
Optional options: Options
Returns undefined | Ranges | Result
raw Listeners
Returns a copy of the array of listeners for the event named
eventName
, including any wrappers (such as those created by.once()
).v0.9.4
Parameters
Optional destination: WritableStream
Optional specific stream to unpipe
-Returns SessionRequest
unshift
Returns SessionRequest
unshift
Passing
chunk
asnull
signals the end of the stream (EOF) and behaves the same asreadable.push(null)
, after which no more data can be written. The EOF signal is put at the end of the buffer and any buffered data will still be @@ -386,7 +386,7 @@Parameters
chunk: any
Chunk of data to unshift onto the read queue. For streams not operating in object mode,
-chunk
must be a string,Buffer
,Uint8Array
ornull
. For object mode streams,chunk
may be any JavaScript value.Optional encoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"
Optional encoding: BufferEncoding
Encoding of string chunks. Must be a valid
Buffer
encoding, such as'utf8'
or'ascii'
.Returns void
wrap
Prior to Node.js 0.10, streams did not implement the entire
stream
module API diff --git a/docs/interfaces/framework_fastify.SessionRequest.html b/docs/interfaces/framework_fastify.SessionRequest.html index 4e08599cd..dc1adeead 100644 --- a/docs/interfaces/framework_fastify.SessionRequest.html +++ b/docs/interfaces/framework_fastify.SessionRequest.html @@ -1,4 +1,4 @@- Preparing search index...
- The search index is not available
supertokens-nodeInterface SessionRequest
Hierarchy
Index
Properties
Properties
body
Readonly connection
Readonly headers
Readonly hostname
id
Readonly ip
Optional Readonly ips
Readonly is404
log
Readonly method
params
Readonly protocol
query
raw
Readonly req
Use
-raw
propertyReadonly router Method
Readonly router Path
Optional session
Readonly socket
Readonly url
Optional validation Error
Readonly router Method
Readonly router Path
Optional session
Readonly socket
Readonly url
Optional validation Error
in order for this to be used the user should ensure they have set the attachValidation option.
Generated using TypeDoc
server
Access: read only and the public server interface. The server object.
-Optional session
Readonly state
Optional session
Readonly state
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.
Readonly url
The parsed request URI.
@@ -116,9 +116,9 @@The value emitted to the subscribers.
Returns Promise<void>
Promise that resolves when all events has been processed. Any errors will cause an immediate rejection.
-generate Response
generate Response
Returns a response which you can pass into the reply interface where:
-Parameters
source: null | string | object
Parameters
source: null | string | object
the value to set as the source of the reply interface, optional.
Optional options: { variety?: string; close?: any; marshal?: any; prepare?: any }
options for the method, optional.
@@ -129,12 +129,12 @@Parameters
name: string
the event name string.
Returns boolean
true if the event name has any listeners, otherwise false.
-log
log
Logs request-specific events. When called, the server emits a 'request' event which can be used by other listeners or plugins. The arguments are:
Parameters
tags: string | string[]
a string or an array of strings (e.g. ['error', 'database', 'read']) used to identify the event. Tags are used instead of log levels and provide a much more expressive mechanism for describing and filtering events.
-Optional data: string | object | (() => ResponseValue)
Optional data: string | object | (() => string | object)
(optional) an message string or object with the application data being logged. If data is a function, the function signature is function() and it called once to generate (return value) the actual data emitted to the listeners. Any logs generated by the server internally will be emitted only on the 'request-internal' channel and will include the event.internal flag set to true.
@@ -150,10 +150,10 @@Optional context: Tcontext
Optional object that binds to the listener handler.
Returns SessionRequest
A reference to the current emitter.
-Type parameters
TArgs: any[] = any[]
Tcontext: object = SessionRequest
Parameters
criteria: string | CriteriaObject
listener: Listener<Tcontext, TArgs>
Optional context: Tcontext
Returns SessionRequest
once
Type parameters
TArgs: any[] = any[]
Tcontext: object = SessionRequest
Parameters
criteria: string | CriteriaObject
listener: Listener<Tcontext, TArgs>
Optional context: Tcontext
Returns SessionRequest
once
Same as podium.on() with the count option set to 1.
Can also be called without an listener to wait for a single event.
-Type parameters
TArgs: any[] = unknown[]
Tcontext: object = SessionRequest
Parameters
criteria: string | Pick<CriteriaObject, "name" | "channels" | "clone" | "filter" | "spread" | "tags">
Type parameters
TArgs: any[] = unknown[]
Tcontext: object = SessionRequest
Parameters
criteria: string | Omit<CriteriaObject, "count">
The subscription criteria.
listener: Listener<Tcontext, TArgs>
The handler method set to receive event updates. The function signature @@ -161,16 +161,16 @@
Optional context: Tcontext
Optional object that binds to the listener handler.
Returns SessionRequest
A reference to the current emitter.
-Type parameters
TArgs: any[] = any[]
Tcontext: object = SessionRequest
Parameters
criteria: string | Pick<CriteriaObject, "name" | "channels" | "clone" | "filter" | "spread" | "tags">
listener: Listener<Tcontext, TArgs>
Optional context: Tcontext
Returns SessionRequest
Type parameters
TArgs: any[] = any[]
Tcontext: object = SessionRequest
Parameters
criteria: string | Omit<CriteriaObject, "count">
listener: Listener<Tcontext, TArgs>
Optional context: Tcontext
Returns SessionRequest
Wait for a single event. The count option is fixed to 1.
-Type parameters
TArgs: any[] = unknown[]
Tcontext: void = void
Parameters
criteria: string | Pick<CriteriaObject, "name" | "channels" | "clone" | "filter" | "spread" | "tags">
Type parameters
TArgs: any[] = unknown[]
Tcontext: void = void
Parameters
criteria: string | Omit<CriteriaObject, "count">
The subscription criteria.
Returns Promise<TArgs>
Promise with array of emitted parameters.
-Type parameters
TArgs: any[] = any[]
Tcontext: void = void
Parameters
criteria: string | Pick<CriteriaObject, "name" | "channels" | "clone" | "filter" | "spread" | "tags">
Returns Promise<TArgs>
register Event
Type parameters
TArgs: any[] = any[]
Tcontext: void = void
Parameters
criteria: string | Omit<CriteriaObject, "count">
Returns Promise<TArgs>
register Event
Register the specified events and their optional configuration. Events must be registered before they can be emitted or subscribed to. This is done to detect event name mispelling and invalid event activities.
-Parameters
events: string | Podium | EventOptions | Event[]
Parameters
events: Event | Event[]
The event(s) to register.
Returns void
register Podium
Registers another emitter as an event source for the current emitter (any event update @@ -198,13 +198,13 @@
Returns void
void Can only be called from an 'onRequest' extension method. See docs
-set Url
set Url
Changes the request URI before the router begins processing the request where: Can only be called from an 'onRequest' extension method.
Parameters
url: string | URL
the new request URI. If url is a string, it is parsed with node's URL parse() method with parseQueryString set to true. url can also be set to an object compatible with node's URL parse() method output.
-Optional stripTrailingSlash: false | true
Optional stripTrailingSlash: boolean
if true, strip the trailing slash from the path. Defaults to false.
Returns void
void See docs
diff --git a/docs/interfaces/framework_koa.SessionContext.html b/docs/interfaces/framework_koa.SessionContext.html index dda1f3c9f..a7878c2cc 100644 --- a/docs/interfaces/framework_koa.SessionContext.html +++ b/docs/interfaces/framework_koa.SessionContext.html @@ -71,7 +71,7 @@ Set query-string as an object.querystring
Get/Set query string.
-req
request
res
Optional respond
req
request
res
Optional respond
To bypass Koa's built-in response handling, you may explicitly set
ctx.respond = false;
response
search
Get the search string. Same as the querystring @@ -81,7 +81,7 @@
secure
Short-hand for:
this.protocol == 'https'
-Optional session
socket
Optional session
socket
Return the request socket.
stale
Check if the request is stale, aka @@ -112,7 +112,7 @@
Checks if the request is writable. Tests for the existence of the socket as node sometimes does not set it.
-Methods
accepts
Methods
accepts
Check if the given
@@ -123,25 +123,25 @@type(s)
is acceptable, returning the best match when true, otherwisefalse
, in which case you should respond with 406 "Not Acceptable".Examples:
-Returns string[]
Parameters
Rest ...types: string[]
Returns string | false
Parameters
types: string[]
Returns string | false
accepts Charsets
Returns string[]
Parameters
Rest ...types: string[]
Returns string | false
Parameters
types: string[]
Returns string | false
accepts Charsets
Return accepted charsets or best fit based on
charsets
.Given
-Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5
an array sorted by quality is returned:Returns string[]
Parameters
Rest ...charsets: string[]
Returns string | false
Parameters
charsets: string[]
Returns string | false
accepts Encodings
Returns string[]
Parameters
Rest ...charsets: string[]
Returns string | false
Parameters
charsets: string[]
Returns string | false
accepts Encodings
Return accepted encodings or best fit based on
encodings
.Given
-Accept-Encoding: gzip, deflate
an array sorted by quality is returned:Returns string[]
Parameters
Rest ...encodings: string[]
Returns string | false
Parameters
encodings: string[]
Returns string | false
accepts Languages
Returns string[]
Parameters
Rest ...encodings: string[]
Returns string | false
Parameters
encodings: string[]
Returns string | false
accepts Languages
Return accepted languages or best fit based on
langs
.Given
-Accept-Language: en;q=0.8, es, pt
an array sorted by quality is returned:Returns string[]
Parameters
Rest ...langs: string[]
Returns string | false
Parameters
langs: string[]
Returns string | false
append
Returns string[]
Parameters
Rest ...langs: string[]
Returns string | false
Parameters
langs: string[]
Returns string | false
append
Append additional header
field
with valueval
.Examples:
Parameters
field: string
Returns string
inspect
util.inspect() implementation, which just returns the JSON output.
-Returns any
is
Returns any
is
Check if the incoming request contains the "Content-Type" header field, and it contains any of the give mime
type
s. If there is no request body,null
is returned. @@ -171,7 +171,7 @@Examples:
-Parameters
Rest ...types: string[]
Returns null | string | false
Parameters
types: string[]
Returns null | string | false
onerror
Parameters
Rest ...types: string[]
Returns null | string | false
Parameters
types: string[]
Returns null | string | false
onerror
Default error handling.
Parameters
err: Error
Returns void
redirect
Perform a 302 redirect to
diff --git a/docs/interfaces/framework_loopback.SessionContext.html b/docs/interfaces/framework_loopback.SessionContext.html index 480aba324..95c009554 100644 --- a/docs/interfaces/framework_loopback.SessionContext.html +++ b/docs/interfaces/framework_loopback.SessionContext.html @@ -14,14 +14,14 @@url
.A flag to tell if the response is finished.
scope
Scope for binding resolution
-Optional session
Readonly subscription Manager
Optional session
Readonly subscription Manager
Manager for observer subscriptions
Protected Readonly tag Indexer
Indexer for bindings by tag
Accessors
parent
Getter for ContextSubscriptionManager
-Returns undefined | Context
Methods
Protected _find By Tag Index
Returns undefined | Context
Methods
Protected _find By Tag Index
Find bindings by tag leveraging indexes
-Type parameters
ValueType = any
Parameters
tag: string | RegExp | Record<string, any>
Type parameters
ValueType = any
Parameters
tag: RegExp | BindingTag
Tag name pattern or name/value pairs
Returns Readonly<Binding<ValueType>>[]
Protected _merge With Parent
Type parameters
ValueType
Parameters
childList: Readonly<Binding<ValueType>>[]
Optional parentList: Readonly<Binding<ValueType>>[]
Returns Readonly<Binding<ValueType>>[]
add
Add a binding to the context. If a locked binding already exists with the @@ -42,25 +42,25 @@
This method MUST be called to avoid memory leaks once a context object is no longer needed and should be recycled. An example is the
-RequestContext
, which is created per request.Returns void
configure
Returns void
configure
Create a corresponding binding for configuration of the target bound by the given key in the context.
For example,
-ctx.configure('controllers.MyController').to({x: 1})
will create bindingcontrollers.MyController:$config
with value{x: 1}
.Type parameters
ConfigValueType = any
Parameters
Optional key: string | BindingKey<unknown>
Type parameters
ConfigValueType = any
Parameters
Optional key: BindingAddress<unknown>
The key for the binding to be configured
Returns Binding<ConfigValueType>
contains
Check if a binding exists with the given key in the local context without delegating to the parent context
Parameters
key: BindingAddress<unknown>
Binding key
-Returns boolean
create View
Returns boolean
create View
Create a view of the context chain with the given binding filter
Type parameters
T = unknown
Parameters
filter: BindingFilter
A function to match bindings
Optional comparator: BindingComparator
A function to sort matched bindings
-Optional options: Pick<ResolutionOptions, "optional" | "asProxyWithInterceptors">
Optional options: Omit<ResolutionOptions, "session">
Resolution options
Returns ContextView<T>
Protected debug
Wrap the debug statement so that it always print out the context name @@ -106,10 +106,10 @@
true
to include the binding in the resultsfalse
to exclude it.Returns Readonly<Binding<ValueType>>[]
find By Tag
Returns Readonly<Binding<ValueType>>[]
find By Tag
Find bindings using the tag filter. If the filter matches one of the binding tags, the binding is included.
-Type parameters
ValueType = any
Parameters
tagFilter: string | RegExp | Record<string, any>
Type parameters
ValueType = any
Parameters
tagFilter: RegExp | BindingTag
A filter for tags. It can be in one of the following forms:
@@ -123,11 +123,11 @@- An object containing tag name/value pairs, such as
-{name: 'my-controller'}
Returns Readonly<Binding<ValueType>>[]
find Or Create Binding
Returns Readonly<Binding<ValueType>>[]
find Or Create Binding
Find or create a binding for the given key
Type parameters
T
Parameters
key: BindingAddress<T>
Binding address
-Optional policy: ALWAYS_CREATE | NEVER_CREATE | CREATE_IF_NOT_BOUND
Optional policy: BindingCreationPolicy
Binding creation policy
Returns Binding<T>
get
Get the value bound to the given key, throw an error when no value is @@ -153,7 +153,7 @@
Options for resolution.
Returns Promise<undefined | ValueType>
A promise of the bound value, or a promise of undefined when the optional binding is not found.
-get Binding
get Binding
Look up a binding by key in the context and its ancestors. If no matching binding is found, an error will be thrown.
Type parameters
ValueType = any
Parameters
key: BindingAddress<ValueType>
Type parameters
ValueType
Parameters
key: BindingAddress<ValueType>
Binding key
-Optional options: { optional?: false | true }
Optional options: { optional?: boolean }
Options to control if the binding is optional. If
-options.optional
is set to true, the method will returnundefined
instead of throwing an error if the binding key is not found.Optional optional?: false | true
Returns undefined | Binding<ValueType>
get Config
Optional optional?: boolean
Returns undefined | Binding<ValueType>
get Config
Resolve configuration for the binding by key
Type parameters
ConfigValueType
Parameters
key: BindingAddress<unknown>
Binding key
@@ -211,9 +211,9 @@Returns the current max listener value for the
EventEmitter
which is either set byemitter.setMaxListeners(n)
or defaults to {@link defaultMaxListeners}.v1.0.0
-Returns number
get Owner Context
Returns number
get Owner Context
Get the owning context for a binding or its key
-Parameters
keyOrBinding: string | BindingKey<unknown> | Readonly<Binding<unknown>>
Parameters
keyOrBinding: BindingAddress<unknown> | Readonly<Binding<unknown>>
Binding object or key
Returns undefined | Context
get Resolution Context
Locate the resolution context for the given binding. Only bindings in the @@ -253,7 +253,7 @@
Optional options: ResolutionOptions
Options for resolution.
Returns undefined | ValueType
The bound value, or undefined when an optional binding is not found.
-get Value Or Promise
get Value Or Promise
Get the value bound to the given key.
This is an internal version that preserves the dual sync/async result of
@@ -262,7 +262,7 @@Binding#getValue()
. Users should useget()
orgetSync()
instead.Type parameters
ValueType
Parameters
keyWithPath: BindingAddress<ValueType>
The binding key, optionally suffixed with a path to the (deeply) nested property to retrieve.
-Optional optionsOrSession: ResolutionOptions | ResolutionSession
Optional optionsOrSession: ResolutionOptionsOrSession
Options for resolution or a session
Returns ValueOrPromise<undefined | ValueType>
The bound value or a promise of the bound value, depending on how the binding is configured.
diff --git a/docs/interfaces/recipe_session.SessionContainer.html b/docs/interfaces/recipe_session.SessionContainer.html index 9a98f2252..4e1ee96bc 100644 --- a/docs/interfaces/recipe_session.SessionContainer.html +++ b/docs/interfaces/recipe_session.SessionContainer.html @@ -1,2 +1,2 @@ -- Preparing search index...
- The search index is not available
supertokens-nodeInterface SessionContainer
Hierarchy
Index
Methods
Methods
assert Claims
Parameters
claimValidators: SessionClaimValidator[]
Optional userContext: any
Returns Promise<void>
fetch And Set Claim
Type parameters
T
Parameters
claim: SessionClaim<T>
Optional userContext: any
Returns Promise<void>
get Access Token
Parameters
Optional userContext: any
Returns string
get Access Token Payload
Parameters
Optional userContext: any
Returns any
get Claim Value
Type parameters
T
Parameters
claim: SessionClaim<T>
Optional userContext: any
Returns Promise<undefined | T>
get Expiry
Parameters
Optional userContext: any
Returns Promise<number>
get Handle
Parameters
Optional userContext: any
Returns string
get Session Data
Parameters
Optional userContext: any
Returns Promise<any>
get Time Created
Parameters
Optional userContext: any
Returns Promise<number>
get User Id
Parameters
Optional userContext: any
Returns string
merge Into Access Token Payload
Parameters
accessTokenPayloadUpdate: JSONObject
Optional userContext: any
Returns Promise<void>
remove Claim
Parameters
claim: SessionClaim<any>
Optional userContext: any
Returns Promise<void>
revoke Session
Parameters
Optional userContext: any
Returns Promise<void>
set Claim Value
Type parameters
T
Parameters
claim: SessionClaim<T>
value: T
Optional userContext: any
Returns Promise<void>
update Access Token Payload
Use mergeIntoAccessTokenPayload instead
-Parameters
newAccessTokenPayload: any
Optional userContext: any
Returns Promise<void>
update Session Data
Parameters
newSessionData: any
Optional userContext: any
Returns Promise<any>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeInterface SessionContainer
Hierarchy
Index
Methods
Methods
assert Claims
Parameters
claimValidators: SessionClaimValidator[]
Optional userContext: any
Returns Promise<void>
fetch And Set Claim
Type parameters
T
Parameters
claim: SessionClaim<T>
Optional userContext: any
Returns Promise<void>
get Access Token
Parameters
Optional userContext: any
Returns string
get Access Token Payload
Parameters
Optional userContext: any
Returns any
get Claim Value
Type parameters
T
Parameters
claim: SessionClaim<T>
Optional userContext: any
Returns Promise<undefined | T>
get Expiry
Parameters
Optional userContext: any
Returns Promise<number>
get Handle
Parameters
Optional userContext: any
Returns string
get Session Data
Parameters
Optional userContext: any
Returns Promise<any>
get Time Created
Parameters
Optional userContext: any
Returns Promise<number>
get User Id
Parameters
Optional userContext: any
Returns string
merge Into Access Token Payload
Parameters
accessTokenPayloadUpdate: JSONObject
Optional userContext: any
Returns Promise<void>
remove Claim
Parameters
claim: SessionClaim<any>
Optional userContext: any
Returns Promise<void>
revoke Session
Parameters
Optional userContext: any
Returns Promise<void>
set Claim Value
Type parameters
T
Parameters
claim: SessionClaim<T>
value: T
Optional userContext: any
Returns Promise<void>
update Access Token Payload
Use mergeIntoAccessTokenPayload instead
+Parameters
newAccessTokenPayload: any
Optional userContext: any
Returns Promise<void>
update Session Data
Parameters
newSessionData: any
Optional userContext: any
Returns Promise<any>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeInterface VerifySessionOptions
Hierarchy
Index
Properties
Methods
Properties
Optional anti Csrf Check
Optional session Required
Methods
Optional override Global Claim Validators
Parameters
globalClaimValidators: SessionClaimValidator[]
session: SessionContainer
userContext: any
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeInterface VerifySessionOptions
Hierarchy
Index
Properties
Methods
Properties
Optional anti Csrf Check
Optional session Required
Methods
Optional override Global Claim Validators
Parameters
globalClaimValidators: SessionClaimValidator[]
session: SessionContainer
userContext: any
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework
Index
Classes
Properties
Variables
Properties
default
Type declaration
aws Lambda: framework/awsLambda
express: framework/express
fastify: framework/fastify
hapi: framework/hapi
koa: framework/koa
loopback: framework/loopback
Variables
aws Lambda
express
fastify
hapi
koa
loopback
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework
Index
Classes
Properties
Variables
Properties
default
Type declaration
aws Lambda: framework/awsLambda
express: framework/express
fastify: framework/fastify
hapi: framework/hapi
koa: framework/koa
loopback: framework/loopback
Variables
aws Lambda
express
fastify
hapi
koa
loopback
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/awsLambda
Index
Interfaces
Functions
Functions
middleware
Parameters
Optional handler: Handler<any, any>
Returns Handler<any, any>
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/awsLambda
Index
Interfaces
Functions
Functions
middleware
Parameters
Optional handler: Handler<any, any>
Returns Handler<any, any>
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/express
Index
Interfaces
Functions
Functions
error Handler
Returns (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>
Parameters
err: any
req: Request
res: Response
next: NextFunction
Returns Promise<void>
middleware
Returns (req: Request, res: Response, next: NextFunction) => Promise<void>
Parameters
req: Request
res: Response
next: NextFunction
Returns Promise<void>
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/express
Index
Interfaces
Functions
Functions
error Handler
Returns (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>
Parameters
err: any
req: Request
res: Response
next: NextFunction
Returns Promise<void>
middleware
Returns (req: Request, res: Response, next: NextFunction) => Promise<void>
Parameters
req: Request
res: Response
next: NextFunction
Returns Promise<void>
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/fastify
Index
Interfaces
Functions
Functions
error Handler
Returns (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>
Parameters
err: any
req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>
res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
Returns Promise<void>
plugin
Parameters
instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
opts: Record<never, never>
done: (err?: Error) => void
Parameters
Optional err: Error
Returns void
Returns void
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/fastify
Index
Interfaces
Functions
Functions
error Handler
Returns (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>
Parameters
err: any
req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>
res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
Returns Promise<void>
plugin
Parameters
instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
opts: Record<never, never>
done: (err?: Error) => void
Parameters
Optional err: Error
Returns void
Returns void
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/hapi
Index
Interfaces
Variables
Functions
Variables
Const plugin
Functions
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/hapi
Index
Interfaces
Variables
Functions
Variables
Const plugin
Functions
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/koa
Index
Interfaces
Functions
Functions
middleware
Returns (ctx: Context, next: Next) => Promise<void>
Parameters
ctx: Context
next: Next
Returns Promise<void>
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/koa
Index
Interfaces
Functions
Functions
middleware
Returns (ctx: Context, next: Next) => Promise<void>
Parameters
ctx: Context
next: Next
Returns Promise<void>
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/loopback
Index
Interfaces
Functions
Functions
middleware
Parameters
context: MiddlewareContext
next: Next
Returns ValueOrPromise<NonVoid>
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule framework/loopback
Index
Interfaces
Functions
Functions
middleware
Parameters
context: MiddlewareContext
next: Next
Returns ValueOrPromise<NonVoid>
wrap Request
Parameters
unwrapped: any
Returns BaseRequest
wrap Response
Parameters
unwrapped: any
Returns BaseResponse
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule index
Index
Classes
Variables
Functions
Variables
Error
Functions
create User Id Mapping
Parameters
input: { externalUserId: string; externalUserIdInfo?: string; force?: false | true; superTokensUserId: string }
external User Id: string
Optional external User Id Info?: string
Optional force?: false | true
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" }>
delete User
Parameters
userId: string
Returns Promise<{ status: "OK" }>
delete User Id Mapping
Parameters
input: { force?: false | true; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
Optional force?: false | true
user Id: string
Optional user Id Type?: "SUPERTOKENS" | "EXTERNAL" | "ANY"
Returns Promise<{ didMappingExist: boolean; status: "OK" }>
get AllCORSHeaders
Returns string[]
get User Count
Parameters
Optional includeRecipeIds: string[]
Returns Promise<number>
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" }>
get Users Newest First
Parameters
Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
get Users Oldest First
Parameters
Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
init
Parameters
config: TypeInput
Returns void
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-nodeModule index
Index
Classes
Variables
Functions
Variables
Error
Functions
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" }>
delete User
Parameters
userId: string
Returns Promise<{ status: "OK" }>
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" }>
get AllCORSHeaders
Returns string[]
get User Count
Parameters
Optional includeRecipeIds: string[]
Returns Promise<number>
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" }>
get Users Newest First
Parameters
Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
get Users Oldest First
Parameters
Optional input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string }
Optional include Recipe Ids?: string[]
Optional limit?: number
Optional pagination Token?: string
Returns Promise<{ nextPaginationToken?: string; users: { recipeId: string; user: any }[] }>
init
Parameters
config: TypeInput
Returns void
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-nodeModule recipe/dashboard
Index
Classes
Type aliases
Functions
Type aliases
APIInterface
Type declaration
dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
get Dashboard Bundle Location:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<string>
should Allow Access:function
Parameters
input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }
config: TypeNormalisedInput
req: BaseRequest
user Context: any
Returns Promise<boolean>
Functions
init
Parameters
config: TypeInput
Returns RecipeListFunction
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/dashboard
Index
Classes
Type aliases
Functions
Type aliases
APIInterface
Type declaration
dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
get Dashboard Bundle Location:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<string>
should Allow Access:function
Parameters
input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }
config: TypeNormalisedInput
req: BaseRequest
user Context: any
Returns Promise<boolean>
Functions
init
Parameters
config: TypeInput
Returns RecipeListFunction
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/emailpassword
Index
Classes
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
email ExistsGET: undefined | ((input: { email: string; options: APIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
generate Password Reset TokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
password ResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
sign InPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
sign UpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
email Delivery: default<TypeEmailPasswordEmailDeliveryInput>
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
create Reset Password Token:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
get User By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<undefined | User>
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
reset Password Using Token:function
Parameters
input: { newPassword: string; token: string; userContext: any }
new Password: string
token: string
user Context: any
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
sign In:function
Parameters
input: { email: string; password: string; userContext: any }
email: string
password: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
sign Up:function
Parameters
input: { email: string; password: string; userContext: any }
email: string
password: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
update Email Or Password:function
Parameters
input: { email?: string; password?: string; userContext: any; userId: string }
Optional email?: string
Optional password?: string
user Context: any
user Id: string
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>
User
Type declaration
email: string
id: string
time Joined: number
Variables
Error
Functions
create Reset Password Token
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
get User By Email
Parameters
email: string
Optional userContext: any
Returns Promise<undefined | User>
get User By Id
Parameters
userId: string
Optional userContext: any
Returns Promise<undefined | User>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
reset Password Using Token
Parameters
token: string
newPassword: string
Optional userContext: any
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
sign In
Parameters
email: string
password: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
sign Up
Parameters
email: string
password: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
update Email Or Password
Parameters
input: { email?: string; password?: string; userContext?: any; userId: string }
Optional email?: string
Optional password?: string
Optional user Context?: any
user Id: string
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/emailpassword
Index
Classes
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
email ExistsGET: undefined | ((input: { email: string; options: APIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
generate Password Reset TokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
password ResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
sign InPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
sign UpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
email Delivery: default<TypeEmailPasswordEmailDeliveryInput>
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
create Reset Password Token:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
get User By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<undefined | User>
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
reset Password Using Token:function
Parameters
input: { newPassword: string; token: string; userContext: any }
new Password: string
token: string
user Context: any
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
sign In:function
Parameters
input: { email: string; password: string; userContext: any }
email: string
password: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
sign Up:function
Parameters
input: { email: string; password: string; userContext: any }
email: string
password: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
update Email Or Password:function
Parameters
input: { email?: string; password?: string; userContext: any; userId: string }
Optional email?: string
Optional password?: string
user Context: any
user Id: string
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>
User
Type declaration
email: string
id: string
time Joined: number
Variables
Error
Functions
create Reset Password Token
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
get User By Email
Parameters
email: string
Optional userContext: any
Returns Promise<undefined | User>
get User By Id
Parameters
userId: string
Optional userContext: any
Returns Promise<undefined | User>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
reset Password Using Token
Parameters
token: string
newPassword: string
Optional userContext: any
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
sign In
Parameters
email: string
password: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
sign Up
Parameters
email: string
password: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
update Email Or Password
Parameters
input: { email?: string; password?: string; userContext?: any; userId: string }
Optional email?: string
Optional password?: string
Optional user Context?: any
user Id: string
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/emailverification
Index
Classes
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
generate Email Verify TokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" } | GeneralErrorResponse>)
is Email VerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; status: "OK" } | GeneralErrorResponse>)
verify EmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; token: string; userContext: any }) => Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
email Delivery: default<TypeEmailVerificationEmailDeliveryInput>
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
create Email Verification Token:function
Parameters
input: { email: string; userContext: any; userId: string }
email: string
user Context: any
user Id: string
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
is Email Verified:function
Parameters
input: { email: string; userContext: any; userId: string }
email: string
user Context: any
user Id: string
Returns Promise<boolean>
revoke Email Verification Tokens:function
Parameters
input: { email: string; userContext: any; userId: string }
email: string
user Context: any
user Id: string
Returns Promise<{ status: "OK" }>
unverify Email:function
Parameters
input: { email: string; userContext: any; userId: string }
email: string
user Context: any
user Id: string
Returns Promise<{ status: "OK" }>
verify Email Using Token:function
Parameters
input: { token: string; userContext: any }
token: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
User
Type declaration
email: string
id: string
Variables
Const Email Verification Claim
Error
Functions
create Email Verification Token
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
init
Parameters
config: TypeInput
Returns RecipeListFunction
is Email Verified
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<boolean>
revoke Email Verification Tokens
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: string }>
send Email
Parameters
input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
unverify Email
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: string }>
verify Email Using Token
Parameters
token: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/emailverification
Index
Classes
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
generate Email Verify TokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "EMAIL_ALREADY_VERIFIED_ERROR" | "OK" } | GeneralErrorResponse>)
is Email VerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; status: "OK" } | GeneralErrorResponse>)
verify EmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; token: string; userContext: any }) => Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
email Delivery: default<TypeEmailVerificationEmailDeliveryInput>
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
create Email Verification Token:function
Parameters
input: { email: string; userContext: any; userId: string }
email: string
user Context: any
user Id: string
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
is Email Verified:function
Parameters
input: { email: string; userContext: any; userId: string }
email: string
user Context: any
user Id: string
Returns Promise<boolean>
revoke Email Verification Tokens:function
Parameters
input: { email: string; userContext: any; userId: string }
email: string
user Context: any
user Id: string
Returns Promise<{ status: "OK" }>
unverify Email:function
Parameters
input: { email: string; userContext: any; userId: string }
email: string
user Context: any
user Id: string
Returns Promise<{ status: "OK" }>
verify Email Using Token:function
Parameters
input: { token: string; userContext: any }
token: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
User
Type declaration
email: string
id: string
Variables
Const Email Verification Claim
Error
Functions
create Email Verification Token
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
init
Parameters
config: TypeInput
Returns RecipeListFunction
is Email Verified
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<boolean>
revoke Email Verification Tokens
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: string }>
send Email
Parameters
input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
unverify Email
Parameters
userId: string
Optional email: string
Optional userContext: any
Returns Promise<{ status: string }>
verify Email Using Token
Parameters
token: string
Optional userContext: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/jwt
Index
Classes
Type aliases
Functions
Type aliases
APIInterface
Type declaration
getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[]; status: "OK" } | GeneralErrorResponse>)
APIOptions
Type declaration
config: TypeNormalisedInput
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Json Web Key
Type declaration
alg: string
e: string
kid: string
kty: string
n: string
use: string
Recipe Interface
Type declaration
createJWT:function
Parameters
input: { payload?: any; userContext: any; validitySeconds?: number }
Optional payload?: any
user Context: any
Optional validity Seconds?: number
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
getJWKS:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
Functions
createJWT
Parameters
payload: any
Optional validitySeconds: number
Optional userContext: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/jwt
Index
Classes
Type aliases
Functions
Type aliases
APIInterface
Type declaration
getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[]; status: "OK" } | GeneralErrorResponse>)
APIOptions
Type declaration
config: TypeNormalisedInput
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Json Web Key
Type declaration
alg: string
e: string
kid: string
kty: string
n: string
use: string
Recipe Interface
Type declaration
createJWT:function
Parameters
input: { payload?: any; userContext: any; validitySeconds?: number }
Optional payload?: any
user Context: any
Optional validity Seconds?: number
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
getJWKS:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
Functions
createJWT
Parameters
payload: any
Optional validitySeconds: number
Optional userContext: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/openid
Index
Classes
Functions
Functions
createJWT
Parameters
Optional payload: any
Optional validitySeconds: number
Optional userContext: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
get Open Id Discovery Configuration
Parameters
Optional userContext: any
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/openid
Index
Classes
Functions
Functions
createJWT
Parameters
Optional payload: any
Optional validitySeconds: number
Optional userContext: any
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
getJWKS
Parameters
Optional userContext: any
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
get Open Id Discovery Configuration
Parameters
Optional userContext: any
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/passwordless
Index
Classes
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
consume CodePOST?:function
Parameters
input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; userContext: any }) | ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; userContext: any })
Returns Promise<GeneralErrorResponse | { createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create CodePOST?:function
Parameters
input: ({ email: string } & { options: APIOptions; userContext: any }) | ({ phoneNumber: string } & { options: APIOptions; userContext: any })
Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" }>
email ExistsGET?:function
Parameters
input: { email: string; options: APIOptions; userContext: any }
email: string
options: APIOptions
user Context: any
Returns Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
phone Number ExistsGET?:function
Parameters
input: { options: APIOptions; phoneNumber: string; userContext: any }
options: APIOptions
phone Number: string
user Context: any
Returns Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
resend CodePOST?:function
Parameters
input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; userContext: any }
Returns Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
email Delivery: default<TypePasswordlessEmailDeliveryInput>
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
sms Delivery: default<TypePasswordlessSmsDeliveryInput>
Recipe Interface
Type declaration
consume Code:function
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create Code:function
Parameters
input: ({ email: string } & { userContext: any; userInputCode?: string }) | ({ phoneNumber: string } & { userContext: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
create New Code For Device:function
Parameters
input: { deviceId: string; userContext: any; userInputCode?: string }
device Id: string
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" }>
get User By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<undefined | User>
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
get User By Phone Number:function
Parameters
input: { phoneNumber: string; userContext: any }
phone Number: string
user Context: any
Returns Promise<undefined | User>
list Codes By Device Id:function
Parameters
input: { deviceId: string; userContext: any }
device Id: string
user Context: any
Returns Promise<undefined | DeviceType>
list Codes By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<DeviceType[]>
list Codes By Phone Number:function
Parameters
input: { phoneNumber: string; userContext: any }
phone Number: string
user Context: any
Returns Promise<DeviceType[]>
list Codes By Pre Auth Session Id:function
Parameters
input: { preAuthSessionId: string; userContext: any }
pre Auth Session Id: string
user Context: any
Returns Promise<undefined | DeviceType>
revoke All Codes:function
Parameters
input: { email: string; userContext: any } | { phoneNumber: string; userContext: any }
Returns Promise<{ status: "OK" }>
revoke Code:function
Parameters
input: { codeId: string; userContext: any }
code Id: string
user Context: any
Returns Promise<{ status: "OK" }>
update User:function
Parameters
input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }
Optional email?: string | null
Optional phone Number?: string | null
user Context: any
user Id: string
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
User
Type declaration
Optional email?: string
id: string
Optional phone Number?: string
time Joined: number
Variables
Error
Functions
consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create Code
Parameters
input: ({ email: string } & { userContext?: any; userInputCode?: string }) | ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
create Magic Link
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<string>
create New Code For Device
Parameters
input: { deviceId: string; userContext?: any; userInputCode?: string }
device 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" }>
get User By Email
Parameters
input: { email: string; userContext?: any }
email: string
Optional user Context?: any
Returns Promise<undefined | User>
get User By Id
Parameters
input: { userContext?: any; userId: string }
Optional user Context?: any
user Id: string
Returns Promise<undefined | User>
get User By Phone Number
Parameters
input: { phoneNumber: string; userContext?: any }
phone Number: string
Optional user Context?: any
Returns Promise<undefined | User>
init
Parameters
config: TypeInput
Returns RecipeListFunction
list Codes By Device Id
Parameters
input: { deviceId: string; userContext?: any }
device Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
list Codes By Email
Parameters
input: { email: string; userContext?: any }
email: string
Optional user Context?: any
Returns Promise<DeviceType[]>
list Codes By Phone Number
Parameters
input: { phoneNumber: string; userContext?: any }
phone Number: string
Optional user Context?: any
Returns Promise<DeviceType[]>
list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; userContext?: any }
pre Auth Session Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
revoke All Codes
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ status: "OK" }>
revoke Code
Parameters
input: { codeId: string; userContext?: any }
code Id: string
Optional user Context?: any
Returns Promise<{ status: "OK" }>
send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
sign In Up
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: string; user: User }>
update User
Parameters
input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
Optional email?: null | string
Optional phone Number?: null | string
Optional user Context?: any
user Id: string
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/passwordless
Index
Classes
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
consume CodePOST?:function
Parameters
input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; userContext: any })
Returns Promise<GeneralErrorResponse | { createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create CodePOST?:function
Parameters
input: ({ email: string } & { options: APIOptions; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; userContext: any })
Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" }>
email ExistsGET?:function
Parameters
input: { email: string; options: APIOptions; userContext: any }
email: string
options: APIOptions
user Context: any
Returns Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
phone Number ExistsGET?:function
Parameters
input: { options: APIOptions; phoneNumber: string; userContext: any }
options: APIOptions
phone Number: string
user Context: any
Returns Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
resend CodePOST?:function
Parameters
input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; userContext: any }
Returns Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
email Delivery: default<TypePasswordlessEmailDeliveryInput>
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
sms Delivery: default<TypePasswordlessSmsDeliveryInput>
Recipe Interface
Type declaration
consume Code:function
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create Code:function
Parameters
input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
create New Code For Device:function
Parameters
input: { deviceId: string; userContext: any; userInputCode?: string }
device Id: string
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" }>
get User By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<undefined | User>
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
get User By Phone Number:function
Parameters
input: { phoneNumber: string; userContext: any }
phone Number: string
user Context: any
Returns Promise<undefined | User>
list Codes By Device Id:function
Parameters
input: { deviceId: string; userContext: any }
device Id: string
user Context: any
Returns Promise<undefined | DeviceType>
list Codes By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<DeviceType[]>
list Codes By Phone Number:function
Parameters
input: { phoneNumber: string; userContext: any }
phone Number: string
user Context: any
Returns Promise<DeviceType[]>
list Codes By Pre Auth Session Id:function
Parameters
input: { preAuthSessionId: string; userContext: any }
pre Auth Session Id: string
user Context: any
Returns Promise<undefined | DeviceType>
revoke All Codes:function
Parameters
input: { email: string; userContext: any } | { phoneNumber: string; userContext: any }
Returns Promise<{ status: "OK" }>
revoke Code:function
Parameters
input: { codeId: string; userContext: any }
code Id: string
user Context: any
Returns Promise<{ status: "OK" }>
update User:function
Parameters
input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }
Optional email?: string | null
Optional phone Number?: string | null
user Context: any
user Id: string
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
User
Type declaration
Optional email?: string
id: string
Optional phone Number?: string
time Joined: number
Variables
Error
Functions
consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create Code
Parameters
input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
create Magic Link
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<string>
create New Code For Device
Parameters
input: { deviceId: string; userContext?: any; userInputCode?: string }
device 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" }>
get User By Email
Parameters
input: { email: string; userContext?: any }
email: string
Optional user Context?: any
Returns Promise<undefined | User>
get User By Id
Parameters
input: { userContext?: any; userId: string }
Optional user Context?: any
user Id: string
Returns Promise<undefined | User>
get User By Phone Number
Parameters
input: { phoneNumber: string; userContext?: any }
phone Number: string
Optional user Context?: any
Returns Promise<undefined | User>
init
Parameters
config: TypeInput
Returns RecipeListFunction
list Codes By Device Id
Parameters
input: { deviceId: string; userContext?: any }
device Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
list Codes By Email
Parameters
input: { email: string; userContext?: any }
email: string
Optional user Context?: any
Returns Promise<DeviceType[]>
list Codes By Phone Number
Parameters
input: { phoneNumber: string; userContext?: any }
phone Number: string
Optional user Context?: any
Returns Promise<DeviceType[]>
list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; userContext?: any }
pre Auth Session Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
revoke All Codes
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ status: "OK" }>
revoke Code
Parameters
input: { codeId: string; userContext?: any }
code Id: string
Optional user Context?: any
Returns Promise<{ status: "OK" }>
send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
sign In Up
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: string; user: User }>
update User
Parameters
input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
Optional email?: null | string
Optional phone Number?: null | string
Optional user Context?: any
user Id: string
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/session
Index
Classes
Interfaces
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
refreshPOST: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<SessionContainer>)
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/session
Index
Classes
Interfaces
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
refreshPOST: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<SessionContainer>)
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
-sign OutPOST: undefined | ((input: { options: APIOptions; session: SessionContainer | undefined; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
verify Session:function
Parameters
input: { options: APIOptions; userContext: any; verifySessionOptions: VerifySessionOptions | undefined }
options: APIOptions
user Context: any
verify Session Options: VerifySessionOptions | undefined
Returns Promise<undefined | SessionContainer>
APIOptions
Type declaration
config: TypeNormalisedInput
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
create New Session:function
Parameters
input: { accessTokenPayload?: any; req: BaseRequest; res: BaseResponse; sessionData?: any; userContext: any; userId: string }
Optional access Token Payload?: any
req: BaseRequest
res: BaseResponse
Optional session Data?: any
user Context: any
user Id: string
Returns Promise<SessionContainer>
fetch And Set Claim:function
Parameters
input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }
claim: SessionClaim<any>
session Handle: string
user Context: any
Returns Promise<boolean>
get Access Token Life TimeMS:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<number>
get All Session Handles For User:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<string[]>
get Claim Value:function
Type parameters
T
Parameters
input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any }
claim: SessionClaim<T>
session Handle: string
user Context: any
Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: T | undefined }>
get Global Claim Validators:function
Parameters
input: { claimValidatorsAddedByOtherRecipes: SessionClaimValidator[]; userContext: any; userId: string }
claim Validators Added By Other Recipes: SessionClaimValidator[]
user Context: any
user Id: string
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
get Refresh Token Life TimeMS:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<number>
get Session:function
Parameters
input: { options?: VerifySessionOptions; req: BaseRequest; res: BaseResponse; userContext: any }
Optional options?: VerifySessionOptions
req: BaseRequest
res: BaseResponse
user Context: any
Returns Promise<undefined | SessionContainer>
get Session Information:function
sign OutPOST: undefined | ((input: { options: APIOptions; session: SessionContainer | undefined; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
verify Session:function
Parameters
input: { options: APIOptions; userContext: any; verifySessionOptions: VerifySessionOptions | undefined }
options: APIOptions
user Context: any
verify Session Options: VerifySessionOptions | undefined
Returns Promise<undefined | SessionContainer>
APIOptions
Type declaration
config: TypeNormalisedInput
is In Serverless Env: boolean
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
create New Session:function
Parameters
input: { accessTokenPayload?: any; req: BaseRequest; res: BaseResponse; sessionData?: any; userContext: any; userId: string }
Optional access Token Payload?: any
req: BaseRequest
res: BaseResponse
Optional session Data?: any
user Context: any
user Id: string
Returns Promise<SessionContainer>
fetch And Set Claim:function
Parameters
input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }
claim: SessionClaim<any>
session Handle: string
user Context: any
Returns Promise<boolean>
get Access Token Life TimeMS:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<number>
get All Session Handles For User:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<string[]>
get Claim Value:function
Type parameters
T
Parameters
input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any }
claim: SessionClaim<T>
session Handle: string
user Context: any
Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: T | undefined }>
get Global Claim Validators:function
Parameters
input: { claimValidatorsAddedByOtherRecipes: SessionClaimValidator[]; userContext: any; userId: string }
claim Validators Added By Other Recipes: SessionClaimValidator[]
user Context: any
user Id: string
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
get Refresh Token Life TimeMS:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<number>
get Session:function
Parameters
input: { options?: VerifySessionOptions; req: BaseRequest; res: BaseResponse; userContext: any }
Optional options?: VerifySessionOptions
req: BaseRequest
res: BaseResponse
user Context: any
Returns Promise<undefined | SessionContainer>
get Session Information:function
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
-Parameters
input: { sessionHandle: string; userContext: any }
session Handle: string
user Context: any
Returns Promise<undefined | SessionInformation>
merge Into Access Token Payload:function
Parameters
input: { accessTokenPayloadUpdate: JSONObject; sessionHandle: string; userContext: any }
access Token Payload Update: JSONObject
session Handle: string
user Context: any
Returns Promise<boolean>
refresh Session:function
Parameters
input: { req: BaseRequest; res: BaseResponse; userContext: any }
req: BaseRequest
res: BaseResponse
user Context: any
Returns Promise<SessionContainer>
regenerate Access Token:function
Parameters
input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }
access Token: string
Optional new Access Token Payload?: any
user Context: any
Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>
Returns false if the sessionHandle does not exist
-remove Claim:function
Parameters
input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }
claim: SessionClaim<any>
session Handle: string
user Context: any
Returns Promise<boolean>
revoke All Sessions For User:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<string[]>
revoke Multiple Sessions:function
Parameters
input: { sessionHandles: string[]; userContext: any }
session Handles: string[]
user Context: any
Returns Promise<string[]>
revoke Session:function
Parameters
input: { sessionHandle: string; userContext: any }
session Handle: string
user Context: any
Returns Promise<boolean>
set Claim Value:function
Type parameters
T
Parameters
input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }
claim: SessionClaim<T>
session Handle: string
user Context: any
value: T
Returns Promise<boolean>
update Access Token Payload:function
Use mergeIntoAccessTokenPayload instead
+Parameters
input: { sessionHandle: string; userContext: any }
session Handle: string
user Context: any
Returns Promise<undefined | SessionInformation>
merge Into Access Token Payload:function
Parameters
input: { accessTokenPayloadUpdate: JSONObject; sessionHandle: string; userContext: any }
access Token Payload Update: JSONObject
session Handle: string
user Context: any
Returns Promise<boolean>
refresh Session:function
Parameters
input: { req: BaseRequest; res: BaseResponse; userContext: any }
req: BaseRequest
res: BaseResponse
user Context: any
Returns Promise<SessionContainer>
regenerate Access Token:function
Parameters
input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }
access Token: string
Optional new Access Token Payload?: any
user Context: any
Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; userDataInJWT: any; userId: string }; status: "OK" }>
Returns false if the sessionHandle does not exist
+remove Claim:function
Parameters
input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }
claim: SessionClaim<any>
session Handle: string
user Context: any
Returns Promise<boolean>
revoke All Sessions For User:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<string[]>
revoke Multiple Sessions:function
Parameters
input: { sessionHandles: string[]; userContext: any }
session Handles: string[]
user Context: any
Returns Promise<string[]>
revoke Session:function
Parameters
input: { sessionHandle: string; userContext: any }
session Handle: string
user Context: any
Returns Promise<boolean>
set Claim Value:function
Type parameters
T
Parameters
input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }
claim: SessionClaim<T>
session Handle: string
user Context: any
value: T
Returns Promise<boolean>
update Access Token Payload:function
Use mergeIntoAccessTokenPayload instead
Parameters
input: { newAccessTokenPayload: any; sessionHandle: string; userContext: any }
new Access Token Payload: any
session Handle: string
user Context: any
Returns Promise<boolean>
Returns false if the sessionHandle does not exist
-update Session Data:function
Parameters
input: { newSessionData: any; sessionHandle: string; userContext: any }
new Session Data: any
session Handle: string
user Context: any
Returns Promise<boolean>
validate Claims:function
Parameters
input: { accessTokenPayload: any; claimValidators: SessionClaimValidator[]; userContext: any; userId: string }
access Token Payload: any
claim Validators: SessionClaimValidator[]
user Context: any
user Id: string
Returns Promise<{ accessTokenPayloadUpdate?: any; invalidClaims: ClaimValidationError[] }>
validate Claims InJWTPayload:function
Parameters
input: { claimValidators: SessionClaimValidator[]; jwtPayload: JSONObject; userContext: any; userId: string }
claim Validators: SessionClaimValidator[]
jwt Payload: JSONObject
user Context: any
user Id: string
Returns Promise<{ invalidClaims: ClaimValidationError[]; status: "OK" }>
Session Claim Validator
Session Information
Type declaration
access Token Payload: any
expiry: number
session Data: any
session Handle: string
time Created: number
user Id: string
Variables
Error
Functions
createJWT
Parameters
Optional payload: any
Optional validitySeconds: number
userContext: any = {}
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
create New Session
Parameters
req: any
res: any
userId: string
accessTokenPayload: any = {}
sessionData: any = {}
userContext: any = {}
Returns Promise<SessionContainer>
fetch And Set Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
get All Session Handles For User
Parameters
userId: string
userContext: any = {}
Returns Promise<string[]>
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 }>
getJWKS
Parameters
userContext: any = {}
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
get Open Id Discovery Configuration
Parameters
userContext: any = {}
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
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>
get Session Information
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<undefined | SessionInformation>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
merge Into Access Token Payload
Parameters
sessionHandle: string
accessTokenPayloadUpdate: JSONObject
userContext: any = {}
Returns Promise<boolean>
refresh Session
Parameters
req: any
res: any
userContext: any = {}
Returns Promise<SessionContainer>
remove Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
revoke All Sessions For User
Parameters
userId: string
userContext: any = {}
Returns Promise<string[]>
revoke Multiple Sessions
Parameters
sessionHandles: string[]
userContext: any = {}
Returns Promise<string[]>
revoke Session
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<boolean>
set Claim Value
Type parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
value: T
userContext: any = {}
Returns Promise<boolean>
update Access Token Payload
Parameters
sessionHandle: string
newAccessTokenPayload: any
userContext: any = {}
Returns Promise<boolean>
update Session Data
Parameters
sessionHandle: string
newSessionData: any
userContext: any = {}
Returns Promise<boolean>
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" }>
validate Claims InJWTPayload
Parameters
userId: string
jwtPayload: JSONObject
Optional overrideGlobalClaimValidators: (globalClaimValidators: SessionClaimValidator[], userId: string, userContext: any) => SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Parameters
globalClaimValidators: SessionClaimValidator[]
userId: string
userContext: any
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
userContext: any = {}
Returns Promise<{ invalidClaims: ClaimValidationError[]; status: "OK" }>
Generated using TypeDoc
update Session Data:function
Parameters
input: { newSessionData: any; sessionHandle: string; userContext: any }
new Session Data: any
session Handle: string
user Context: any
Returns Promise<boolean>
validate Claims:function
Parameters
input: { accessTokenPayload: any; claimValidators: SessionClaimValidator[]; userContext: any; userId: string }
access Token Payload: any
claim Validators: SessionClaimValidator[]
user Context: any
user Id: string
Returns Promise<{ accessTokenPayloadUpdate?: any; invalidClaims: ClaimValidationError[] }>
validate Claims InJWTPayload:function
Parameters
input: { claimValidators: SessionClaimValidator[]; jwtPayload: JSONObject; userContext: any; userId: string }
claim Validators: SessionClaimValidator[]
jwt Payload: JSONObject
user Context: any
user Id: string
Returns Promise<{ invalidClaims: ClaimValidationError[]; status: "OK" }>
Session Claim Validator
Session Information
Type declaration
access Token Payload: any
expiry: number
session Data: any
session Handle: string
time Created: number
user Id: string
Variables
Error
Functions
createJWT
Parameters
Optional payload: any
Optional validitySeconds: number
userContext: any = {}
Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
create New Session
Parameters
req: any
res: any
userId: string
accessTokenPayload: any = {}
sessionData: any = {}
userContext: any = {}
Returns Promise<SessionContainer>
fetch And Set Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
get All Session Handles For User
Parameters
userId: string
userContext: any = {}
Returns Promise<string[]>
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 }>
getJWKS
Parameters
userContext: any = {}
Returns Promise<{ keys: JsonWebKey[]; status: "OK" }>
get Open Id Discovery Configuration
Parameters
userContext: any = {}
Returns Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
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>
get Session Information
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<undefined | SessionInformation>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
merge Into Access Token Payload
Parameters
sessionHandle: string
accessTokenPayloadUpdate: JSONObject
userContext: any = {}
Returns Promise<boolean>
refresh Session
Parameters
req: any
res: any
userContext: any = {}
Returns Promise<SessionContainer>
remove Claim
Parameters
sessionHandle: string
claim: SessionClaim<any>
userContext: any = {}
Returns Promise<boolean>
revoke All Sessions For User
Parameters
userId: string
userContext: any = {}
Returns Promise<string[]>
revoke Multiple Sessions
Parameters
sessionHandles: string[]
userContext: any = {}
Returns Promise<string[]>
revoke Session
Parameters
sessionHandle: string
userContext: any = {}
Returns Promise<boolean>
set Claim Value
Type parameters
T
Parameters
sessionHandle: string
claim: SessionClaim<T>
value: T
userContext: any = {}
Returns Promise<boolean>
update Access Token Payload
Parameters
sessionHandle: string
newAccessTokenPayload: any
userContext: any = {}
Returns Promise<boolean>
update Session Data
Parameters
sessionHandle: string
newSessionData: any
userContext: any = {}
Returns Promise<boolean>
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" }>
validate Claims InJWTPayload
Parameters
userId: string
jwtPayload: JSONObject
Optional overrideGlobalClaimValidators: (globalClaimValidators: SessionClaimValidator[], userId: string, userContext: any) => SessionClaimValidator[] | Promise<SessionClaimValidator[]>
Parameters
globalClaimValidators: SessionClaimValidator[]
userId: string
userContext: any
Returns SessionClaimValidator[] | Promise<SessionClaimValidator[]>
userContext: any = {}
Returns Promise<{ invalidClaims: ClaimValidationError[]; status: "OK" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/thirdparty
Index
Classes
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
apple Redirect HandlerPOST: undefined | ((input: { code: string; options: APIOptions; state: string; userContext: any }) => Promise<void>)
authorisation UrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
sign In UpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: APIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>)
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
is In Serverless Env: boolean
providers: TypeProvider[]
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
get User By Third Party Info:function
Parameters
input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<undefined | User>
get Users By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<User[]>
sign In Up:function
Parameters
input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
email: string
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Type Provider
Type declaration
id: string
Optional is Default?: boolean
get:function
Parameters
redirectURI: undefined | string
authCodeFromRequest: undefined | string
userContext: any
Returns TypeProviderGetResponse
User
Type declaration
email: string
id: string
third Party: { id: string; userId: string }
id: string
user Id: string
time Joined: number
Variables
Error
Functions
Apple
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Discord
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Facebook
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Github
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Google
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Google Workspaces
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
get User By Id
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
get User By Third Party Info
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
get Users By Email
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
init
Parameters
config: TypeInput
Returns RecipeListFunction
sign In Up
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/thirdparty
Index
Classes
Type aliases
Variables
Functions
Type aliases
APIInterface
Type declaration
apple Redirect HandlerPOST: undefined | ((input: { code: string; options: APIOptions; state: string; userContext: any }) => Promise<void>)
authorisation UrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
sign In UpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: APIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | GeneralErrorResponse>)
APIOptions
Type declaration
app Info: NormalisedAppinfo
config: TypeNormalisedInput
is In Serverless Env: boolean
providers: TypeProvider[]
recipe Id: string
recipe Implementation: RecipeInterface
req: BaseRequest
res: BaseResponse
Recipe Interface
Type declaration
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
get User By Third Party Info:function
Parameters
input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<undefined | User>
get Users By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<User[]>
sign In Up:function
Parameters
input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
email: string
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Type Provider
Type declaration
id: string
Optional is Default?: boolean
get:function
Parameters
redirectURI: undefined | string
authCodeFromRequest: undefined | string
userContext: any
Returns TypeProviderGetResponse
User
Type declaration
email: string
id: string
third Party: { id: string; userId: string }
id: string
user Id: string
time Joined: number
Variables
Error
Functions
Apple
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Discord
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Facebook
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Github
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Google
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Google Workspaces
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
get User By Id
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
get User By Third Party Info
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
get Users By Email
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
init
Parameters
config: TypeInput
Returns RecipeListFunction
sign In Up
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/thirdpartyemailpassword
Index
References
Classes
Type aliases
Variables
Functions
References
Type Provider
Re-exports TypeProviderType aliases
APIInterface
Type declaration
apple Redirect HandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>)
authorisation UrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
email Password Email ExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
email Password Sign InPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
email Password Sign UpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
generate Password Reset TokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
password ResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
third Party Sign In UpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>)
Email PasswordAPIOptions
Recipe Interface
Type declaration
create Reset Password Token:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
email Password Sign In:function
Parameters
input: { email: string; password: string; userContext: any }
email: string
password: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
email Password Sign Up:function
Parameters
input: { email: string; password: string; userContext: any }
email: string
password: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
get User By Third Party Info:function
Parameters
input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<undefined | User>
get Users By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<User[]>
reset Password Using Token:function
Parameters
input: { newPassword: string; token: string; userContext: any }
new Password: string
token: string
user Context: any
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
third Party Sign In Up:function
Parameters
input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
email: string
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
update Email Or Password:function
Parameters
input: { email?: string; password?: string; userContext: any; userId: string }
Optional email?: string
Optional password?: string
user Context: any
user Id: string
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>
Third PartyAPIOptions
User
Type declaration
email: string
id: string
Optional third Party?: { id: string; userId: string }
id: string
user Id: string
time Joined: number
Variables
Error
Functions
Apple
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Discord
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Facebook
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Github
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Google
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Google Workspaces
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
create Reset Password Token
Parameters
userId: string
userContext: any = {}
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
email Password Sign In
Parameters
email: string
password: string
userContext: any = {}
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
email Password Sign Up
Parameters
email: string
password: string
userContext: any = {}
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
get User By Id
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
get User By Third Party Info
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
get Users By Email
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
init
Parameters
config: TypeInput
Returns RecipeListFunction
reset Password Using Token
Parameters
token: string
newPassword: string
userContext: any = {}
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
third Party Sign In Up
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
update Email Or Password
Parameters
input: { email?: string; password?: string; userContext?: any; userId: string }
Optional email?: string
Optional password?: string
Optional user Context?: any
user Id: string
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/thirdpartyemailpassword
Index
References
Classes
Type aliases
Variables
Functions
References
Type Provider
Re-exports TypeProviderType aliases
APIInterface
Type declaration
apple Redirect HandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>)
authorisation UrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
email Password Email ExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
email Password Sign InPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
email Password Sign UpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
generate Password Reset TokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>)
password ResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; token: string; userContext: any }) => Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
third Party Sign In UpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>)
Email PasswordAPIOptions
Recipe Interface
Type declaration
create Reset Password Token:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
email Password Sign In:function
Parameters
input: { email: string; password: string; userContext: any }
email: string
password: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
email Password Sign Up:function
Parameters
input: { email: string; password: string; userContext: any }
email: string
password: string
user Context: any
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
get User By Third Party Info:function
Parameters
input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<undefined | User>
get Users By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<User[]>
reset Password Using Token:function
Parameters
input: { newPassword: string; token: string; userContext: any }
new Password: string
token: string
user Context: any
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
third Party Sign In Up:function
Parameters
input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
email: string
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
update Email Or Password:function
Parameters
input: { email?: string; password?: string; userContext: any; userId: string }
Optional email?: string
Optional password?: string
user Context: any
user Id: string
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" }>
Third PartyAPIOptions
User
Type declaration
email: string
id: string
Optional third Party?: { id: string; userId: string }
id: string
user Id: string
time Joined: number
Variables
Error
Functions
Apple
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Discord
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Facebook
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Github
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Google
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Google Workspaces
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
create Reset Password Token
Parameters
userId: string
userContext: any = {}
Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
email Password Sign In
Parameters
email: string
password: string
userContext: any = {}
Returns Promise<{ status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
email Password Sign Up
Parameters
email: string
password: string
userContext: any = {}
Returns Promise<{ status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
get User By Id
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
get User By Third Party Info
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
get Users By Email
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
init
Parameters
config: TypeInput
Returns RecipeListFunction
reset Password Using Token
Parameters
token: string
newPassword: string
userContext: any = {}
Returns Promise<{ status: "OK"; userId?: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
send Email
Parameters
input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
third Party Sign In Up
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
update Email Or Password
Parameters
input: { email?: string; password?: string; userContext?: any; userId: string }
Optional email?: string
Optional password?: string
Optional user Context?: any
user Id: string
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/thirdpartypasswordless
Index
References
Classes
Type aliases
Variables
Functions
References
Type Provider
Re-exports TypeProviderType aliases
APIInterface
Type declaration
apple Redirect HandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>)
authorisation UrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
consume CodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" }>)
create CodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | GeneralErrorResponse>)
passwordless User Email ExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
passwordless User Phone Number ExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
resend CodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
third Party Sign In UpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>)
PasswordlessAPIOptions
Recipe Interface
Type declaration
consume Code:function
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create Code:function
Parameters
input: ({ email: string } & { userContext: any; userInputCode?: string }) | ({ phoneNumber: string } & { userContext: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
create New Code For Device:function
Parameters
input: { deviceId: string; userContext: any; userInputCode?: string }
device Id: string
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" }>
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
get User By Phone Number:function
Parameters
input: { phoneNumber: string; userContext: any }
phone Number: string
user Context: any
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
get User By Third Party Info:function
Parameters
input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
get Users By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<User[]>
list Codes By Device Id:function
Parameters
input: { deviceId: string; userContext: any }
device Id: string
user Context: any
Returns Promise<undefined | DeviceType>
list Codes By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<DeviceType[]>
list Codes By Phone Number:function
Parameters
input: { phoneNumber: string; userContext: any }
phone Number: string
user Context: any
Returns Promise<DeviceType[]>
list Codes By Pre Auth Session Id:function
Parameters
input: { preAuthSessionId: string; userContext: any }
pre Auth Session Id: string
user Context: any
Returns Promise<undefined | DeviceType>
revoke All Codes:function
Parameters
input: { email: string; userContext: any } | { phoneNumber: string; userContext: any }
Returns Promise<{ status: "OK" }>
revoke Code:function
Parameters
input: { codeId: string; userContext: any }
code Id: string
user Context: any
Returns Promise<{ status: "OK" }>
third Party Sign In Up:function
Parameters
input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
email: string
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
update Passwordless User:function
Parameters
input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }
Optional email?: string | null
Optional phone Number?: string | null
user Context: any
user Id: string
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Third PartyAPIOptions
User
Variables
Error
Functions
Apple
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Discord
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Facebook
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Github
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Google
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Google Workspaces
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create Code
Parameters
input: ({ email: string } & { userContext?: any; userInputCode?: string }) | ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
create Magic Link
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<string>
create New Code For Device
Parameters
input: { deviceId: string; userContext?: any; userInputCode?: string }
device 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" }>
get User By Id
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
get User By Phone Number
Parameters
input: { phoneNumber: string; userContext?: any }
phone Number: string
Optional user Context?: any
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
get User By Third Party Info
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | ({ email?: string; phoneNumber?: string } & { id: string; timeJoined: number }) | ({ email: string; thirdParty: { id: string; userId: string } } & { id: string; timeJoined: number })>
get Users By Email
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
init
Parameters
config: TypeInput
Returns RecipeListFunction
list Codes By Device Id
Parameters
input: { deviceId: string; userContext?: any }
device Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
list Codes By Email
Parameters
input: { email: string; userContext?: any }
email: string
Optional user Context?: any
Returns Promise<DeviceType[]>
list Codes By Phone Number
Parameters
input: { phoneNumber: string; userContext?: any }
phone Number: string
Optional user Context?: any
Returns Promise<DeviceType[]>
list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; userContext?: any }
pre Auth Session Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
passwordless Sign In Up
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: string; user: User }>
revoke All Codes
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ status: "OK" }>
revoke Code
Parameters
input: { codeId: string; userContext?: any }
code Id: string
Optional user Context?: any
Returns Promise<{ status: "OK" }>
send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
third Party Sign In Up
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
update Passwordless User
Parameters
input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
Optional email?: null | string
Optional phone Number?: null | string
Optional user Context?: any
user Id: string
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/thirdpartypasswordless
Index
References
Classes
Type aliases
Variables
Functions
References
Type Provider
Re-exports TypeProviderType aliases
APIInterface
Type declaration
apple Redirect HandlerPOST: undefined | ((input: { code: string; options: ThirdPartyAPIOptions; state: string; userContext: any }) => Promise<void>)
authorisation UrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; userContext: any }) => Promise<{ status: "OK"; url: string } | GeneralErrorResponse>)
consume CodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" }>)
create CodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | GeneralErrorResponse>)
passwordless User Email ExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
passwordless User Phone Number ExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
resend CodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
third Party Sign In UpPOST: undefined | ((input: { authCodeResponse?: any; clientId?: string; code: string; options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURI: string; userContext: any }) => Promise<{ authCodeResponse: any; createdNewUser: boolean; session: SessionContainer; status: "OK"; user: User } | GeneralErrorResponse | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>)
PasswordlessAPIOptions
Recipe Interface
Type declaration
consume Code:function
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext: any }
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create Code:function
Parameters
input: ({ email: string } & { userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
create New Code For Device:function
Parameters
input: { deviceId: string; userContext: any; userInputCode?: string }
device Id: string
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" }>
get User By Id:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<undefined | User>
get User By Phone Number:function
Parameters
input: { phoneNumber: string; userContext: any }
phone Number: string
user Context: any
Returns Promise<undefined | User>
get User By Third Party Info:function
Parameters
input: { thirdPartyId: string; thirdPartyUserId: string; userContext: any }
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<undefined | User>
get Users By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<User[]>
list Codes By Device Id:function
Parameters
input: { deviceId: string; userContext: any }
device Id: string
user Context: any
Returns Promise<undefined | DeviceType>
list Codes By Email:function
Parameters
input: { email: string; userContext: any }
email: string
user Context: any
Returns Promise<DeviceType[]>
list Codes By Phone Number:function
Parameters
input: { phoneNumber: string; userContext: any }
phone Number: string
user Context: any
Returns Promise<DeviceType[]>
list Codes By Pre Auth Session Id:function
Parameters
input: { preAuthSessionId: string; userContext: any }
pre Auth Session Id: string
user Context: any
Returns Promise<undefined | DeviceType>
revoke All Codes:function
Parameters
input: { email: string; userContext: any } | { phoneNumber: string; userContext: any }
Returns Promise<{ status: "OK" }>
revoke Code:function
Parameters
input: { codeId: string; userContext: any }
code Id: string
user Context: any
Returns Promise<{ status: "OK" }>
third Party Sign In Up:function
Parameters
input: { email: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
email: string
third Party Id: string
third Party User Id: string
user Context: any
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
update Passwordless User:function
Parameters
input: { email?: string | null; phoneNumber?: string | null; userContext: any; userId: string }
Optional email?: string | null
Optional phone Number?: string | null
user Context: any
user Id: string
Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Third PartyAPIOptions
User
Variables
Error
Functions
Apple
Parameters
config: TypeThirdPartyProviderAppleConfig
Returns TypeProvider
Discord
Parameters
config: TypeThirdPartyProviderDiscordConfig
Returns TypeProvider
Facebook
Parameters
config: TypeThirdPartyProviderFacebookConfig
Returns TypeProvider
Github
Parameters
config: TypeThirdPartyProviderGithubConfig
Returns TypeProvider
Google
Parameters
config: TypeThirdPartyProviderGoogleConfig
Returns TypeProvider
Google Workspaces
Parameters
config: TypeThirdPartyProviderGoogleWorkspacesConfig
Returns TypeProvider
consume Code
Parameters
input: { deviceId: string; preAuthSessionId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
create Code
Parameters
input: ({ email: string } & { userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { userContext?: any; userInputCode?: string })
Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
create Magic Link
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<string>
create New Code For Device
Parameters
input: { deviceId: string; userContext?: any; userInputCode?: string }
device 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" }>
get User By Id
Parameters
userId: string
userContext: any = {}
Returns Promise<undefined | User>
get User By Phone Number
Parameters
input: { phoneNumber: string; userContext?: any }
phone Number: string
Optional user Context?: any
Returns Promise<undefined | User>
get User By Third Party Info
Parameters
thirdPartyId: string
thirdPartyUserId: string
userContext: any = {}
Returns Promise<undefined | User>
get Users By Email
Parameters
email: string
userContext: any = {}
Returns Promise<User[]>
init
Parameters
config: TypeInput
Returns RecipeListFunction
list Codes By Device Id
Parameters
input: { deviceId: string; userContext?: any }
device Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
list Codes By Email
Parameters
input: { email: string; userContext?: any }
email: string
Optional user Context?: any
Returns Promise<DeviceType[]>
list Codes By Phone Number
Parameters
input: { phoneNumber: string; userContext?: any }
phone Number: string
Optional user Context?: any
Returns Promise<DeviceType[]>
list Codes By Pre Auth Session Id
Parameters
input: { preAuthSessionId: string; userContext?: any }
pre Auth Session Id: string
Optional user Context?: any
Returns Promise<undefined | DeviceType>
passwordless Sign In Up
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ createdNewUser: boolean; status: string; user: User }>
revoke All Codes
Parameters
input: { email: string; userContext?: any } | { phoneNumber: string; userContext?: any }
Returns Promise<{ status: "OK" }>
revoke Code
Parameters
input: { codeId: string; userContext?: any }
code Id: string
Optional user Context?: any
Returns Promise<{ status: "OK" }>
send Email
Parameters
input: TypePasswordlessEmailDeliveryInput & { userContext?: any }
Returns Promise<void>
send Sms
Parameters
input: TypePasswordlessSmsDeliveryInput & { userContext?: any }
Returns Promise<void>
third Party Sign In Up
Parameters
thirdPartyId: string
thirdPartyUserId: string
email: string
userContext: any = {}
Returns Promise<{ createdNewUser: boolean; status: "OK"; user: User }>
update Passwordless User
Parameters
input: { email?: null | string; phoneNumber?: null | string; userContext?: any; userId: string }
Optional email?: null | string
Optional phone Number?: null | string
Optional user Context?: any
user Id: string
Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" }>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/usermetadata
Index
Classes
Interfaces
Type aliases
Functions
Type aliases
Recipe Interface
Type declaration
clear User Metadata:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ status: "OK" }>
get User Metadata:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ metadata: any; status: "OK" }>
update User Metadata:function
- Preparing search index...
- The search index is not available
supertokens-nodeModule recipe/usermetadata
Index
Classes
Interfaces
Type aliases
Functions
Type aliases
Recipe Interface
Type declaration
clear User Metadata:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ status: "OK" }>
get User Metadata:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ metadata: any; status: "OK" }>
update User Metadata:function
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 } }
Parameters
input: { metadataUpdate: JSONObject; userContext: any; userId: string }
metadata Update: JSONObject
user Context: any
user Id: string
Returns Promise<{ metadata: JSONObject; status: "OK" }>
Functions
clear User Metadata
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK" }>
get User Metadata
Parameters
userId: string
Optional userContext: any
Returns Promise<{ metadata: any; status: "OK" }>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
update User Metadata
Parameters
userId: string
metadataUpdate: JSONObject
Optional userContext: any
Returns Promise<{ metadata: JSONObject; status: "OK" }>
Generated using TypeDoc
Parameters
input: { metadataUpdate: JSONObject; userContext: any; userId: string }
metadata Update: JSONObject
user Context: any
user Id: string
Returns Promise<{ metadata: JSONObject; status: "OK" }>
Functions
clear User Metadata
Parameters
userId: string
Optional userContext: any
Returns Promise<{ status: "OK" }>
get User Metadata
Parameters
userId: string
Optional userContext: any
Returns Promise<{ metadata: any; status: "OK" }>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
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-nodeModule recipe/userroles
Index
Classes
Type aliases
Variables
Functions
Type aliases
Recipe Interface
Type declaration
add Role To User:function
Parameters
input: { role: string; userContext: any; userId: string }
role: string
user Context: any
user Id: string
Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
create New Role Or Add Permissions:function
Parameters
input: { permissions: string[]; role: string; userContext: any }
permissions: string[]
role: string
user Context: any
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
delete Role:function
Parameters
input: { role: string; userContext: any }
role: string
user Context: any
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
get All Roles:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Permissions For Role:function
Parameters
input: { role: string; userContext: any }
role: string
user Context: any
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
get Roles For User:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ roles: string[]; status: "OK" }>
get Roles That Have Permission:function
Parameters
input: { permission: string; userContext: any }
permission: string
user Context: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Users That Have Role:function
Parameters
input: { role: string; userContext: any }
role: string
user Context: any
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
remove Permissions From Role:function
Parameters
input: { permissions: string[]; role: string; userContext: any }
permissions: string[]
role: string
user Context: any
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
remove User Role:function
Parameters
input: { role: string; userContext: any; userId: string }
role: string
user Context: any
user Id: string
Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Variables
Const Permission Claim
Const User Role Claim
Functions
add Role To User
Parameters
userId: string
role: string
Optional userContext: any
Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
create New Role Or Add Permissions
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
delete Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
get All Roles
Parameters
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Permissions For Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
get Roles For User
Parameters
userId: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Roles That Have Permission
Parameters
permission: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Users That Have Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
remove Permissions From Role
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
remove User Role
Parameters
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-nodeModule recipe/userroles
Index
Classes
Type aliases
Variables
Functions
Type aliases
Recipe Interface
Type declaration
add Role To User:function
Parameters
input: { role: string; userContext: any; userId: string }
role: string
user Context: any
user Id: string
Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
create New Role Or Add Permissions:function
Parameters
input: { permissions: string[]; role: string; userContext: any }
permissions: string[]
role: string
user Context: any
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
delete Role:function
Parameters
input: { role: string; userContext: any }
role: string
user Context: any
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
get All Roles:function
Parameters
input: { userContext: any }
user Context: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Permissions For Role:function
Parameters
input: { role: string; userContext: any }
role: string
user Context: any
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
get Roles For User:function
Parameters
input: { userContext: any; userId: string }
user Context: any
user Id: string
Returns Promise<{ roles: string[]; status: "OK" }>
get Roles That Have Permission:function
Parameters
input: { permission: string; userContext: any }
permission: string
user Context: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Users That Have Role:function
Parameters
input: { role: string; userContext: any }
role: string
user Context: any
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
remove Permissions From Role:function
Parameters
input: { permissions: string[]; role: string; userContext: any }
permissions: string[]
role: string
user Context: any
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
remove User Role:function
Parameters
input: { role: string; userContext: any; userId: string }
role: string
user Context: any
user Id: string
Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Variables
Const Permission Claim
Const User Role Claim
Functions
add Role To User
Parameters
userId: string
role: string
Optional userContext: any
Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
create New Role Or Add Permissions
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ createdNewRole: boolean; status: "OK" }>
delete Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ didRoleExist: boolean; status: "OK" }>
get All Roles
Parameters
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Permissions For Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
get Roles For User
Parameters
userId: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Roles That Have Permission
Parameters
permission: string
Optional userContext: any
Returns Promise<{ roles: string[]; status: "OK" }>
get Users That Have Role
Parameters
role: string
Optional userContext: any
Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
init
Parameters
Optional config: TypeInput
Returns RecipeListFunction
remove Permissions From Role
Parameters
role: string
permissions: string[]
Optional userContext: any
Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
remove User Role
Parameters
userId: string
role: string
Optional userContext: any
Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
Generated using TypeDoc