supertokens-web-js/recipe/emailverification
References documentation for the supertokens-web-js/recipe/emailverification package
Classes
default
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Constructors
Constructor
new default(): default;
Returns
Properties
| Property | Modifier | Type | Default value | Defined in |
|---|---|---|---|---|
EmailVerificationClaim |
static |
EmailVerificationClaimClass |
Recipe.EmailVerificationClaim |
tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts |
Methods
getEmailVerificationTokenFromURL()
static getEmailVerificationTokenFromURL(input?): string;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: any; } |
input.userContext? |
any |
Returns
string
getTenantIdFromURL()
static getTenantIdFromURL(input?): string;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Reads and returns the tenant id from the current URL
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: any; } |
input.userContext? |
any |
Returns
string
The “tenantId” query parameter from the current location
init()
static init(config?): CreateRecipeFunction<PreAndPostAPIHookAction>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Parameters
| Parameter | Type |
|---|---|
config? |
UserInput |
Returns
CreateRecipeFunction<PreAndPostAPIHookAction>
isEmailVerified()
static isEmailVerified(input?): Promise<{
fetchResponse: Response;
isVerified: boolean;
status: "OK";
}>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Check if an email has been verified
Parameters
| Parameter | Type |
|---|---|
input? |
{ options?: RecipeFunctionOptions; userContext?: any; } |
input.options? |
RecipeFunctionOptions |
input.userContext? |
any |
Returns
Promise<{
fetchResponse: Response;
isVerified: boolean;
status: "OK";
}>
{status: "OK", isVerified: boolean}
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
sendVerificationEmail()
static sendVerificationEmail(input?): Promise<{
fetchResponse: Response;
status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR";
}>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Send an email to the user for verification.
Parameters
| Parameter | Type |
|---|---|
input? |
{ options?: RecipeFunctionOptions; userContext?: any; } |
input.options? |
RecipeFunctionOptions |
input.userContext? |
any |
Returns
Promise<{
fetchResponse: Response;
status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR";
}>
{status: "OK"} if successfull
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
verifyEmail()
static verifyEmail(input?): Promise<{
fetchResponse: Response;
status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR";
}>;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Verify an email
Parameters
| Parameter | Type |
|---|---|
input? |
{ options?: RecipeFunctionOptions; userContext?: any; } |
input.options? |
RecipeFunctionOptions |
input.userContext? |
any |
Returns
Promise<{
fetchResponse: Response;
status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR";
}>
{status: "OK"} if successfull
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
EmailVerificationClaimClass
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/emailVerificationClaim.ts
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.
Extends
Constructors
Constructor
new EmailVerificationClaimClass(getRecipeImpl): EmailVerificationClaimClass;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/emailVerificationClaim.ts
Parameters
| Parameter | Type |
|---|---|
getRecipeImpl |
() => RecipeInterface |
Returns
Overrides
Properties
| Property | Modifier | Type | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
defaultMaxAgeInSeconds |
readonly |
number |
- | PrimitiveClaim.defaultMaxAgeInSeconds |
node_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts |
id |
readonly |
string |
- | PrimitiveClaim.id |
node_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts |
refresh |
readonly |
(userContext) => Promise<void> |
- | BooleanClaim.refresh |
node_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts |
validators |
public |
object & BooleanValidators & object |
BooleanClaim.validators |
- | tmp/supertokens-web-js/lib/ts/recipe/emailverification/emailVerificationClaim.ts |
Methods
getLastFetchedTime()
getLastFetchedTime(payload, _userContext?): number;
Defined in: node_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts
Parameters
| Parameter | Type |
|---|---|
payload |
any |
_userContext? |
any |
Returns
number
Inherited from
BooleanClaim.getLastFetchedTime
getValueFromPayload()
getValueFromPayload(payload, _userContext?): boolean;
Defined in: node_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts
Parameters
| Parameter | Type |
|---|---|
payload |
any |
_userContext? |
any |
Returns
boolean
Inherited from
BooleanClaim.getValueFromPayload
Variables
EmailVerificationClaim
const EmailVerificationClaim: EmailVerificationClaimClass = RecipeWrapper.EmailVerificationClaim;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
getEmailVerificationTokenFromURL()
const getEmailVerificationTokenFromURL: (input?) => string = RecipeWrapper.getEmailVerificationTokenFromURL;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: any; } |
input.userContext? |
any |
Returns
string
getTenantIdFromURL()
const getTenantIdFromURL: (input?) => string = RecipeWrapper.getTenantIdFromURL;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Reads and returns the tenant id from the current URL
Parameters
| Parameter | Type |
|---|---|
input? |
{ userContext?: any; } |
input.userContext? |
any |
Returns
string
The “tenantId” query parameter from the current location
init()
const init: (config?) => CreateRecipeFunction<PreAndPostAPIHookAction> = RecipeWrapper.init;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Parameters
| Parameter | Type |
|---|---|
config? |
UserInput |
Returns
CreateRecipeFunction<PreAndPostAPIHookAction>
isEmailVerified()
const isEmailVerified: (input?) => Promise<{
fetchResponse: Response;
isVerified: boolean;
status: "OK";
}> = RecipeWrapper.isEmailVerified;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Check if an email has been verified
Parameters
| Parameter | Type |
|---|---|
input? |
{ options?: RecipeFunctionOptions; userContext?: any; } |
input.options? |
RecipeFunctionOptions |
input.userContext? |
any |
Returns
Promise<{
fetchResponse: Response;
isVerified: boolean;
status: "OK";
}>
{status: "OK", isVerified: boolean}
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
sendVerificationEmail()
const sendVerificationEmail: (input?) => Promise<{
fetchResponse: Response;
status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR";
}> = RecipeWrapper.sendVerificationEmail;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Send an email to the user for verification.
Parameters
| Parameter | Type |
|---|---|
input? |
{ options?: RecipeFunctionOptions; userContext?: any; } |
input.options? |
RecipeFunctionOptions |
input.userContext? |
any |
Returns
Promise<{
fetchResponse: Response;
status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR";
}>
{status: "OK"} if successfull
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
verifyEmail()
const verifyEmail: (input?) => Promise<{
fetchResponse: Response;
status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR";
}> = RecipeWrapper.verifyEmail;
Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts
Verify an email
Parameters
| Parameter | Type |
|---|---|
input? |
{ options?: RecipeFunctionOptions; userContext?: any; } |
input.options? |
RecipeFunctionOptions |
input.userContext? |
any |
Returns
Promise<{
fetchResponse: Response;
status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR";
}>
{status: "OK"} if successfull
Throws
STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"
References
PostAPIHookContext
Re-exports PostAPIHookContext
PreAPIHookContext
Re-exports PreAPIHookContext
RecipeFunctionOptions
Re-exports RecipeFunctionOptions
RecipeInterface
Re-exports RecipeInterface
UserInput
Re-exports UserInput