Skip to main content
References

EmailVerification

Classes

default

Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:21

Constructors

Constructor
new default(): default;
Returns

default

Properties

PropertyModifierTypeDefault valueDefined in
EmailVerificationClaimstaticEmailVerificationClaimClassRecipe.EmailVerificationClaimtmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:22

Methods

getEmailVerificationTokenFromURL()
static getEmailVerificationTokenFromURL(input?): string;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:94

Parameters
ParameterType
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:108

Reads and returns the tenant id from the current URL

Parameters
ParameterType
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:24

Parameters
ParameterType
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:83

Check if an email has been verified

Parameters
ParameterType
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:62

Send an email to the user for verification.

Parameters
ParameterType
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:40

Verify an email

Parameters
ParameterType
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:13

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:14

Parameters
ParameterType
getRecipeImpl() => RecipeInterface
Returns

EmailVerificationClaimClass

Overrides

BooleanClaim.constructor

Properties

PropertyModifierTypeOverridesInherited fromDefined in
defaultMaxAgeInSecondsreadonlynumber-PrimitiveClaim.defaultMaxAgeInSecondsnode_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:10
idreadonlystring-PrimitiveClaim.idnode_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:8
refreshreadonly(userContext) => Promise<void>-BooleanClaim.refreshnode_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:9
validatorspublicobject & BooleanValidators & objectBooleanClaim.validators-tmp/supertokens-web-js/lib/ts/recipe/emailverification/emailVerificationClaim.ts:82

Methods

getLastFetchedTime()
getLastFetchedTime(payload, _userContext?): number;

Defined in: node_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:13

Parameters
ParameterType
payloadany
_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:12

Parameters
ParameterType
payloadany
_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:122

getEmailVerificationTokenFromURL()

const getEmailVerificationTokenFromURL: (input?) => string = RecipeWrapper.getEmailVerificationTokenFromURL;

Defined in: tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:120

Parameters

ParameterType
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:121

Reads and returns the tenant id from the current URL

Parameters

ParameterType
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:116

Parameters

ParameterType
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:119

Check if an email has been verified

Parameters

ParameterType
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:118

Send an email to the user for verification.

Parameters

ParameterType
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:117

Verify an email

Parameters

ParameterType
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