\ No newline at end of file
diff --git a/docs/classes/recipe_authRecipe.default.html b/docs/classes/recipe_authRecipe.default.html
index 7d772e77..d2e95c46 100644
--- a/docs/classes/recipe_authRecipe.default.html
+++ b/docs/classes/recipe_authRecipe.default.html
@@ -1 +1 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/classes/recipe_emailpassword.default.html b/docs/classes/recipe_emailpassword.default.html
index 59eac3ae..0331f9c0 100644
--- a/docs/classes/recipe_emailpassword.default.html
+++ b/docs/classes/recipe_emailpassword.default.html
@@ -1,23 +1,23 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/classes/recipe_emailverification.default.html b/docs/classes/recipe_emailverification.default.html
index a4ab5194..cd0390ea 100644
--- a/docs/classes/recipe_emailverification.default.html
+++ b/docs/classes/recipe_emailverification.default.html
@@ -1,12 +1,12 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/classes/recipe_recipeModule.default.html b/docs/classes/recipe_recipeModule.default.html
index ff83bf2f..a8e7230b 100644
--- a/docs/classes/recipe_recipeModule.default.html
+++ b/docs/classes/recipe_recipeModule.default.html
@@ -1 +1 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/classes/recipe_session.default.html b/docs/classes/recipe_session.default.html
index 80a545b2..2f74845b 100644
--- a/docs/classes/recipe_session.default.html
+++ b/docs/classes/recipe_session.default.html
@@ -1 +1 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/classes/recipe_thirdparty.default.html b/docs/classes/recipe_thirdparty.default.html
index 3f550a49..3b6aeac9 100644
--- a/docs/classes/recipe_thirdparty.default.html
+++ b/docs/classes/recipe_thirdparty.default.html
@@ -1,32 +1,32 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/classes/recipe_thirdpartyemailpassword.default.html b/docs/classes/recipe_thirdpartyemailpassword.default.html
index 1034470c..5d2c8ce7 100644
--- a/docs/classes/recipe_thirdpartyemailpassword.default.html
+++ b/docs/classes/recipe_thirdpartyemailpassword.default.html
@@ -1,52 +1,52 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/classes/recipe_thirdpartypasswordless.default.html b/docs/classes/recipe_thirdpartypasswordless.default.html
index 03ec9ea2..7276857e 100644
--- a/docs/classes/recipe_thirdpartypasswordless.default.html
+++ b/docs/classes/recipe_thirdpartypasswordless.default.html
@@ -1,65 +1,65 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/classes/recipe_userroles.default.html b/docs/classes/recipe_userroles.default.html
index 4f9b0cb3..3069c1b2 100644
--- a/docs/classes/recipe_userroles.default.html
+++ b/docs/classes/recipe_userroles.default.html
@@ -1 +1 @@
-default | supertokens-web-js
\ No newline at end of file
diff --git a/docs/modules/index.html b/docs/modules/index.html
index 1767be29..8d956a13 100644
--- a/docs/modules/index.html
+++ b/docs/modules/index.html
@@ -1 +1 @@
-index | supertokens-web-js
\ No newline at end of file
diff --git a/docs/modules/recipe_emailpassword.html b/docs/modules/recipe_emailpassword.html
index 99865bf0..ad73390c 100644
--- a/docs/modules/recipe_emailpassword.html
+++ b/docs/modules/recipe_emailpassword.html
@@ -1,29 +1,29 @@
-recipe/emailpassword | supertokens-web-js
For the options object passed to recipe functions, we do not need a postAPIHook.
This is because these functions will be called manually, so the user always knows which API is called (making the
postAPIHook redundant). They can consume the networkResponse returned by recipe functions as a way to handle post
API logic
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static does Email Exist
Check if an email exists
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
email: string
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
-{status: "OK", doesExist: boolean}
Static get Reset Password Token FromURL
Static get Reset Password Token FromURL
Reads and returns the reset password token from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "token" query parameter from the current location
-Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static send Password Reset Email
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static send Password Reset Email
Send an email to the user for password reset
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
form Fields: { id: string; value: string }[]
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
-{status: "OK"}
if successfullStatic sign In
Static sign In
Sign in a user with email and password
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
form Fields: { id: string; value: string }[]
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK"; user: UserType } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" }>
-{status: "OK"}
if successfullStatic sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static sign Up
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static sign Up
Sign up a user with email and password
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
form Fields: { id: string; value: string }[]
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK"; user: UserType } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
-{status: "OK"}
if successfullStatic submit New Password
Static submit New Password
Submit a new password for the user
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
form Fields: { id: string; value: string }[]
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
diff --git a/docs/classes/recipe_emailverification.EmailVerificationClaimClass.html b/docs/classes/recipe_emailverification.EmailVerificationClaimClass.html index 673b5f18..fdccaab5 100644 --- a/docs/classes/recipe_emailverification.EmailVerificationClaimClass.html +++ b/docs/classes/recipe_emailverification.EmailVerificationClaimClass.html @@ -1,5 +1,5 @@{status: "OK"}
if successfull- Preparing search index...
- The search index is not available
supertokens-web-jsClass EmailVerificationClaimClass
We include "Class" in the class name, because it makes it easier to import/use the right thing (the instance exported by the recipe) instead of this.
-Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
getRecipeImpl: () => RecipeInterface
Returns RecipeInterface
Optional updateContextOnIsVerifiedFalse: (userContext: any) => void | Promise<void>
Parameters
userContext: any
Returns void | Promise<void>
Returns EmailVerificationClaimClass
Properties
Readonly default Max Age In Seconds
Readonly id
Readonly refresh
Type declaration
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
getRecipeImpl: () => RecipeInterface
Returns RecipeInterface
Optional updateContextOnIsVerifiedFalse: (userContext: any) => void | Promise<void>
Parameters
userContext: any
Returns void | Promise<void>
Returns EmailVerificationClaimClass
Properties
Readonly default Max Age In Seconds
Readonly id
Readonly refresh
Type declaration
Makes an API call that will refresh the claim in the token.
-Parameters
userContext: any
Returns Promise<void>
validators
Methods
get Last Fetched Time
Parameters
payload: any
Optional _userContext: any
Returns undefined | number
get Value From Payload
Parameters
payload: any
Optional _userContext: any
Returns boolean
Generated using TypeDoc
Parameters
userContext: any
Returns Promise<void>
validators
Methods
get Last Fetched Time
Parameters
payload: any
Optional _userContext: any
Returns undefined | number
get Value From Payload
Parameters
payload: any
Optional _userContext: any
Returns boolean
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Email Verification Claim
Methods
Static get Email Verification Token FromURL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static is Email Verified
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Properties
Methods
Constructors
constructor
Returns default
Properties
Static Email Verification Claim
Methods
Static get Email Verification Token FromURL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static is Email Verified
Check if an email has been verified
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any }
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
-{status: "OK", isVerified: boolean}
Static send Verification Email
Static send Verification Email
Send an email to the user for verification.
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any }
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
-{status: "OK"}
if successfullStatic verify Email
Static verify Email
Verify an email
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any }
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index 4a028bc7..52443389 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1,34 +1,34 @@ -{status: "OK"}
if successfull- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static clear Login Attempt Info
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static clear Login Attempt Info
Clear any information about login attempts from storage
-Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static consume Code
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static consume Code
Log the user in using the input code or link code
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }
Returns Promise<{ createdNewUser: boolean; fetchResponse: Response; status: "OK"; user: PasswordlessUser } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" }>
-{status: "OK", user, createdNewUser: bool}
if succesfulStatic create Code
Static create Code
Create and send a code to the user for passwordless auth
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
Returns Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" }>
-{status: "OK", deviceId, preAuthSessionId, flowType}
If successfulStatic does Email Exist
Static does Email Exist
Check if a user with the given email exists
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
email: string
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
-{status: "OK", doesExist: boolean}
Static does Phone Number Exist
Static does Phone Number Exist
Check if a user with the given phone number exists
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
Optional options?: RecipeFunctionOptions
phone Number: string
Optional user Context?: any
Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
-{status: "OK", doesExist: boolean}
Static get Link Code FromURL
Static get Link Code FromURL
Reads and returns the link code from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The hash (#) property of the current URL
-Static get Login Attempt Info
Static get Login Attempt Info
Get information about the current login attempt from storage
Type parameters
CustomLoginAttemptInfoProperties
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<undefined | ({ deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties)>
-{deviceId, preAuthSessionId, flowType}
if present, returns undefined otherwiseStatic get Pre Auth Session Id FromURL
Static get Pre Auth Session Id FromURL
Reads and returns the pre auth session id from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "preAuthSessionId" query parameter from the current URL
-Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static resend Code
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static resend Code
Resend the code to the user
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any }
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
-{status: "OK"}
if succesfulStatic set Login Attempt Info
Static set Login Attempt Info
Set information about the current login attempt to storage
-Type parameters
CustomStateProperties
Parameters
input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
attempt Info: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Generated using TypeDoc
Type parameters
CustomStateProperties
Parameters
input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
attempt Info: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default<Action, NormalisedConfig>
Type parameters
Action
NormalisedConfig: NormalisedRecipeConfig<Action>
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type parameters
Action
NormalisedConfig: NormalisedRecipeConfig<Action>
Parameters
config: NormalisedConfig
Returns default<Action, NormalisedConfig>
Properties
config
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default<Action, NormalisedConfig>
Type parameters
Action
NormalisedConfig: NormalisedRecipeConfig<Action>
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Type parameters
Action
NormalisedConfig: NormalisedRecipeConfig<Action>
Parameters
config: NormalisedConfig
Returns default<Action, NormalisedConfig>
Properties
config
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static add Axios Interceptors
Parameters
axiosInstance: any
Optional userContext: any
Returns void
Static attempt Refreshing Session
Returns Promise<boolean>
Static does Session Exist
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<boolean>
Static get Access Token Payload Securely
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<any>
Static get Claim Value
Type parameters
T
Parameters
input: { claim: SessionClaim<T>; userContext?: any }
claim: SessionClaim<T>
Optional user Context?: any
Returns Promise<undefined | T>
Static get Invalid Claims From Response
Parameters
input: { response: Response | { data: any }; userContext?: any }
response: Response | { data: any }
Optional user Context?: any
Returns Promise<ClaimValidationError[]>
Static get User Id
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<string>
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<unknown>
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static validate Claims
Parameters
Optional input: { userContext?: any; overrideGlobalClaimValidators?: any }
Optional user Context?: any
override Global Claim Validators?:function
Parameters
globalClaimValidators: SessionClaimValidator[]
userContext: any
Returns SessionClaimValidator[]
Returns ClaimValidationError[] | Promise<ClaimValidationError[]>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static add Axios Interceptors
Parameters
axiosInstance: any
Optional userContext: any
Returns void
Static attempt Refreshing Session
Returns Promise<boolean>
Static does Session Exist
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<boolean>
Static get Access Token Payload Securely
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<any>
Static get Claim Value
Type parameters
T
Parameters
input: { claim: SessionClaim<T>; userContext?: any }
claim: SessionClaim<T>
Optional user Context?: any
Returns Promise<undefined | T>
Static get Invalid Claims From Response
Parameters
input: { response: Response | { data: any }; userContext?: any }
response: Response | { data: any }
Optional user Context?: any
Returns Promise<ClaimValidationError[]>
Static get User Id
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<string>
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<unknown>
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static validate Claims
Parameters
Optional input: { userContext?: any; overrideGlobalClaimValidators?: any }
Optional user Context?: any
override Global Claim Validators?:function
Parameters
globalClaimValidators: SessionClaimValidator[]
userContext: any
Returns SessionClaimValidator[]
Returns ClaimValidationError[] | Promise<ClaimValidationError[]>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static generate State To Send ToOAuth Provider
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static generate State To Send ToOAuth Provider
Generate a new state that will be sent to the third party provider
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
string
-Static get Auth Code FromURL
Static get Auth Code FromURL
Returns the auth code from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "code" query param from the current URL. Returns an empty string if no code exists
-Static get Auth Error FromURL
Static get Auth Error FromURL
Returns the error from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns undefined | string
The "error" query param from the current URL. Returns undefined if no error exists
-Static get Auth State FromURL
Static get Auth State FromURL
Returns the auth state from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "state" query param from the current URL. Returns an empty string if no state exists
-Static get AuthorisationURLFrom Backend
Static get AuthorisationURLFrom Backend
Get the URL to be used by the third party provider for redirecting after the auth flow
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { options?: RecipeFunctionOptions; providerId: string; userContext?: any }
Optional options?: RecipeFunctionOptions
provider Id: string
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK"; url: string }>
-{status: "OK", url}
Static get AuthorisationURLWith Query Params And Set State
Static get AuthorisationURLWith Query Params And Set State
Get the URL that should be opened for third party authentication
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { authorisationURL: string; options?: RecipeFunctionOptions; providerClientId?: string; providerId: string; userContext?: any }
authorisationURL: string
Optional options?: RecipeFunctionOptions
Optional provider Client Id?: string
provider Id: string
Optional user Context?: any
Returns Promise<string>
URL string
-Static get State And Other Info From Storage
Static get State And Other Info From Storage
Get the current login state from storage, this is also used when calling signInUp
Type parameters
CustomStateProperties
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns undefined | (StateObject & CustomStateProperties)
State object from storage
-Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static set State And Other Info To Storage
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static set State And Other Info To Storage
Set the login state to storage
-Type parameters
CustomStateProperties
Parameters
input: { state: StateObject & CustomStateProperties; userContext?: any }
state: StateObject & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static sign In And Up
Type parameters
CustomStateProperties
Parameters
input: { state: StateObject & CustomStateProperties; userContext?: any }
state: StateObject & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static sign In And Up
Sign up/Sign in the user, this method uses the login attempt information from storage
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any }
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ createdNewUser: boolean; fetchResponse: Response; status: "OK"; user: ThirdPartyUserType } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>
-{status: OK, user, createdNewUser: boolean}
if succesfulStatic sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static verify And Get State Or Throw Error
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static verify And Get State Or Throw Error
Verify that the state recieved from the third party provider matches the one in storage
Type parameters
CustomStateProperties
Parameters
input: { stateFromAuthProvider: undefined | string; stateObjectFromStorage: undefined | (StateObject & CustomStateProperties); userContext?: any }
state From Auth Provider: undefined | string
state Object From Storage: undefined | (StateObject & CustomStateProperties)
Optional user Context?: any
Returns Promise<StateObject & CustomStateProperties>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static does Email Exist
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static does Email Exist
Check if an email exists
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
email: string
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
-{status: "OK", doesExist: boolean}
Static email Password Sign In
Static email Password Sign In
Sign in a user with email and password
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
form Fields: { id: string; value: string }[]
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK"; user: UserType } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" }>
-{status: "OK"}
if successfullStatic email Password Sign Up
Static email Password Sign Up
Sign up a user with email and password
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
form Fields: { id: string; value: string }[]
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK"; user: UserType } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
-{status: "OK"}
if successfullStatic generate State To Send ToOAuth Provider
Static generate State To Send ToOAuth Provider
Generate a new state that will be sent to the thirs party provider
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
string
-Static get Auth Code FromURL
Static get Auth Code FromURL
Returns the auth code from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "code" query param from the current URL. Returns an empty string if no code exists
-Static get Auth Error FromURL
Static get Auth Error FromURL
Returns the error from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns undefined | string
The "error" query param from the current URL. Returns undefined if no error exists
-Static get Auth State FromURL
Static get Auth State FromURL
Returns the auth state from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "state" query param from the current URL. Returns an empty string if no state exists
-Static get AuthorisationURLFrom Backend
Static get AuthorisationURLFrom Backend
Get the URL to be used by the third party provider for redirecting after the auth flow
Parameters
input: { options?: RecipeFunctionOptions; providerId: string; userContext?: any }
Optional options?: RecipeFunctionOptions
provider Id: string
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK"; url: string }>
-{status: "OK", url}
Static get AuthorisationURLWith Query Params And Set State
Static get AuthorisationURLWith Query Params And Set State
Get the URL that should be opened for third party authentication
Parameters
input: { authorisationURL: string; options?: RecipeFunctionOptions; providerClientId?: string; providerId: string; userContext?: any }
authorisationURL: string
Optional options?: RecipeFunctionOptions
Optional provider Client Id?: string
provider Id: string
Optional user Context?: any
Returns Promise<string>
URL string
-Static get Reset Password Token FromURL
Static get Reset Password Token FromURL
Reads and returns the reset password token from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "token" query parameter from the current location
-Static get State And Other Info From Storage
Static get State And Other Info From Storage
Get the current login state from storage, this is also used when calling signInUp
Type parameters
CustomStateProperties
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns undefined | (StateObject & CustomStateProperties)
State object from storage
-Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static send Password Reset Email
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static send Password Reset Email
Send an email to the user for password reset
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
form Fields: { id: string; value: string }[]
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
-{status: "OK"}
if successfullStatic set State And Other Info To Storage
Static set State And Other Info To Storage
Set the login state to storage
-Type parameters
CustomStateProperties
Parameters
input: { state: StateObject & CustomStateProperties; userContext?: any }
state: StateObject & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static submit New Password
Type parameters
CustomStateProperties
Parameters
input: { state: StateObject & CustomStateProperties; userContext?: any }
state: StateObject & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static submit New Password
Submit a new password for the user
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
form Fields: { id: string; value: string }[]
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
-{status: "OK"}
if successfullStatic third Party Sign In And Up
Static third Party Sign In And Up
Sign up/Sign in the user, this method uses the login attempt information from storage
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any }
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ createdNewUser: boolean; fetchResponse: Response; status: "OK"; user: ThirdPartyUserType } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>
-{status: OK, user, createdNewUser: boolean}
if succesfulStatic verify And Get State Or Throw Error
Static verify And Get State Or Throw Error
Verify that the state recieved from the third party provider matches the one in storage
Type parameters
CustomStateProperties
Parameters
input: { stateFromAuthProvider: undefined | string; stateObjectFromStorage: undefined | (StateObject & CustomStateProperties); userContext?: any }
state From Auth Provider: undefined | string
state Object From Storage: undefined | (StateObject & CustomStateProperties)
Optional user Context?: any
Returns Promise<StateObject & CustomStateProperties>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static clear Passwordless Login Attempt Info
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
Static clear Passwordless Login Attempt Info
Clear any information about login attempts from storage
-Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static consume Passwordless Code
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static consume Passwordless Code
Log the user in using the input code or link code
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }
Returns Promise<{ createdNewUser: boolean; fetchResponse: Response; status: "OK"; user: PasswordlessUser } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" }>
-{status: "OK", user, createdNewUser: bool}
if succesfulStatic create Passwordless Code
Static create Passwordless Code
Create and send a code to the user for passwordless auth
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
Returns Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" }>
-{status: "OK", deviceId, preAuthSessionId, flowType}
If successfulStatic does Passwordless User Email Exist
Static does Passwordless User Email Exist
Check if a user with the given email exists
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { email: string; options?: RecipeFunctionOptions; userContext?: any }
email: string
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
-{status: "OK", doesExist: boolean}
Static does Passwordless User Phone Number Exist
Static does Passwordless User Phone Number Exist
Check if a user with the given phone number exists
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }
Optional options?: RecipeFunctionOptions
phone Number: string
Optional user Context?: any
Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
-{status: "OK", doesExist: boolean}
Static generate Third Party State To Send ToOAuth Provider
Static generate Third Party State To Send ToOAuth Provider
Generate a new state that will be sent to the thirs party provider
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
string
-Static get AuthorisationURLFrom Backend
Static get AuthorisationURLFrom Backend
Get the URL to be used by the third party provider for redirecting after the auth flow
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { options?: RecipeFunctionOptions; providerId: string; userContext?: any }
Optional options?: RecipeFunctionOptions
provider Id: string
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK"; url: string }>
-{status: "OK", url}
Static get Passwordless Link Code FromURL
Static get Passwordless Link Code FromURL
Reads and returns the link code from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The hash (#) property of the current URL
-Static get Passwordless Login Attempt Info
Static get Passwordless Login Attempt Info
Get information about the current login attempt from storage
Type parameters
CustomLoginAttemptInfoProperties
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<undefined | ({ deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomLoginAttemptInfoProperties)>
-{deviceId, preAuthSessionId, flowType}
if present, returns undefined otherwiseStatic get Passwordless Pre Auth Session Id FromURL
Static get Passwordless Pre Auth Session Id FromURL
Reads and returns the pre auth session id from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "preAuthSessionId" query parameter from the current URL
-Static get Third Party Auth Code FromURL
Static get Third Party Auth Code FromURL
Returns the auth code from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "code" query param from the current URL. Returns an empty string if no code exists
-Static get Third Party Auth Error FromURL
Static get Third Party Auth Error FromURL
Returns the error from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns undefined | string
The "error" query param from the current URL. Returns undefined if no error exists
-Static get Third Party Auth State FromURL
Static get Third Party Auth State FromURL
Returns the auth state from the current URL
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns string
The "state" query param from the current URL. Returns an empty string if no state exists
-Static get Third Party AuthorisationURLWith Query Params And Set State
Static get Third Party AuthorisationURLWith Query Params And Set State
Get the URL that should be opened for third party authentication
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { authorisationURL: string; options?: RecipeFunctionOptions; providerClientId?: string; providerId: string; userContext?: any }
authorisationURL: string
Optional options?: RecipeFunctionOptions
Optional provider Client Id?: string
provider Id: string
Optional user Context?: any
Returns Promise<string>
URL string
-Static get Third Party State And Other Info From Storage
Static get Third Party State And Other Info From Storage
Get the current login state from storage, this is also used when calling signInUp
Type parameters
CustomStateProperties
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns undefined | (StateObject & CustomStateProperties)
State object from storage
-Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static resend Passwordless Code
Static init
Parameters
Optional config: UserInput
Returns CreateRecipeFunction<PreAndPostAPIHookAction>
Static resend Passwordless Code
Resend the code to the user
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any }
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
-{status: "OK"}
if succesfulStatic set Passwordless Login Attempt Info
Static set Passwordless Login Attempt Info
Set information about the current login attempt to storage
-Type parameters
CustomStateProperties
Parameters
input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
attempt Info: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static set Third Party State And Other Info To Storage
Type parameters
CustomStateProperties
Parameters
input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
attempt Info: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static set Third Party State And Other Info To Storage
Set the login state to storage
-Type parameters
CustomStateProperties
Parameters
input: { state: StateObject & CustomStateProperties; userContext?: any }
state: StateObject & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static third Party Sign In And Up
Type parameters
CustomStateProperties
Parameters
input: { state: StateObject & CustomStateProperties; userContext?: any }
state: StateObject & CustomStateProperties
Optional user Context?: any
Returns Promise<void>
Static sign Out
Parameters
Optional input: { userContext?: any }
Optional user Context?: any
Returns Promise<void>
Static third Party Sign In And Up
Sign up/Sign in the user, this method uses the login attempt information from storage
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
Optional input: { options?: RecipeFunctionOptions; userContext?: any }
Optional options?: RecipeFunctionOptions
Optional user Context?: any
Returns Promise<{ createdNewUser: boolean; fetchResponse: Response; status: "OK"; user: ThirdPartyUserType } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" }>
-{status: OK, user, createdNewUser: boolean}
if succesfulStatic verify And Get Third Party State Or Throw Error
Static verify And Get Third Party State Or Throw Error
Verify that the state recieved from the third party provider matches the one in storage
Type parameters
CustomStateProperties
Parameters
input: { stateFromAuthProvider: undefined | string; stateObjectFromStorage: undefined | (StateObject & CustomStateProperties); userContext?: any }
state From Auth Provider: undefined | string
state Object From Storage: undefined | (StateObject & CustomStateProperties)
Optional user Context?: any
Returns Promise<StateObject & CustomStateProperties>
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Returns default
Properties
Static Permission Claim
Static User Role Claim
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsClass default
Hierarchy
Index
Constructors
Properties
Constructors
constructor
Returns default
Properties
Static Permission Claim
Static User Role Claim
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsModule index
Index
Classes
Functions
Functions
Const init
Parameters
config: SuperTokensConfig
Returns void
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsModule index
Index
Classes
Functions
Functions
Const init
Parameters
config: SuperTokensConfig
Returns void
Generated using TypeDoc
- Preparing search index...
- The search index is not available
supertokens-web-jsModule recipe/emailpassword
Index
Classes
Type aliases
Functions
Type aliases
PostAPIHook Context
PreAPIHook Context
Recipe Function Options
- Preparing search index...
- The search index is not available
supertokens-web-jsModule recipe/emailpassword
Index
Classes
Type aliases
Functions
Type aliases
PostAPIHook Context
PreAPIHook Context
Recipe Function Options
For the options object passed to recipe functions, we do not need a postAPIHook.
This is because these functions will be called manually, so the user always knows which API is called (making the postAPIHook redundant). They can consume the networkResponse returned by recipe functions as a way to handle post API logic
-Type declaration
preAPIHook?:function
Parameters
input: { requestInit: RequestInit; url: string; userContext: any }
request Init: RequestInit
url: string
user Context: any
Returns Promise<{ requestInit: RequestInit; url: string }>
Recipe Interface
Type declaration
does Email Exist:function
Type declaration
preAPIHook?:function
Parameters
input: { requestInit: RequestInit; url: string; userContext: any }
request Init: RequestInit
url: string
user Context: any
Returns Promise<{ requestInit: RequestInit; url: string }>
Recipe Interface
Type declaration
does Email Exist:function
Check if an email exists
STGeneralError if the API exposed by the backend SDKs returns
status: "GENERAL_ERROR"
Parameters
input: { email: string; options?: RecipeFunctionOptions; userContext: any }
email: string
Optional options?: RecipeFunctionOptions
user Context: any
Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
-{status: "OK", doesExist: boolean}
get Reset Password Token FromURL:function
get Reset Password Token FromURL:function