---
title: supertokens-web-js/recipe/emailverification
description: References documentation for the supertokens-web-js/recipe/emailverification package
sidebar:
  order: 50
---

## Classes

### default

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:21](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L21)

#### Constructors

##### Constructor

```ts check=false reason="Generated API signature"
new default(): default;
```

###### Returns

[`default`](#default)

#### Properties

| Property | Modifier | Type | Default value | Defined in |
| ------ | ------ | ------ | ------ | ------ |
| <a id="member-default-emailverificationclaim"></a> `EmailVerificationClaim` | `static` | [`EmailVerificationClaimClass`](#emailverificationclaimclass) | `Recipe.EmailVerificationClaim` | [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:22](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L22) |

#### Methods

##### getEmailVerificationTokenFromURL()

```ts check=false reason="Generated API signature"
static getEmailVerificationTokenFromURL(input?): string;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:94](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L94)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: `any`; \} |
| `input.userContext?` | `any` |

###### Returns

`string`

##### getTenantIdFromURL()

```ts check=false reason="Generated API signature"
static getTenantIdFromURL(input?): string;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:108](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L108)

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()

```ts check=false reason="Generated API signature"
static init(config?): CreateRecipeFunction<PreAndPostAPIHookAction>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:24](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L24)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-emailverification-types#userinput) |

###### Returns

[`CreateRecipeFunction`](types#createrecipefunction)\<[`PreAndPostAPIHookAction`](recipe-emailverification-types#preandpostapihookaction)\>

##### isEmailVerified()

```ts check=false reason="Generated API signature"
static isEmailVerified(input?): Promise<{
  fetchResponse: Response;
  isVerified: boolean;
  status: "OK";
}>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:83](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L83)

Check if an email has been verified

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#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()

```ts check=false reason="Generated API signature"
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](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L62)

Send an email to the user for verification.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#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()

```ts check=false reason="Generated API signature"
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](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L40)

Verify an email

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#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](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/emailVerificationClaim.ts#L13)

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

- [`BooleanClaim`](recipe-session#booleanclaim)

#### Constructors

##### Constructor

```ts check=false reason="Generated API signature"
new EmailVerificationClaimClass(getRecipeImpl): EmailVerificationClaimClass;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/emailVerificationClaim.ts:14](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/emailVerificationClaim.ts#L14)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `getRecipeImpl` | () => [`RecipeInterface`](recipe-emailverification-types#recipeinterface) |

###### Returns

[`EmailVerificationClaimClass`](#emailverificationclaimclass)

###### Overrides

[`BooleanClaim`](recipe-session#booleanclaim).[`constructor`](recipe-session#constructor)

#### Properties

| Property | Modifier | Type | Overrides | Inherited from | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
| <a id="defaultmaxageinseconds"></a> `defaultMaxAgeInSeconds` | `readonly` | `number` | - | [`PrimitiveClaim`](recipe-session#primitiveclaim).[`defaultMaxAgeInSeconds`](recipe-session#defaultmaxageinseconds-2) | node\_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:10 |
| <a id="id"></a> `id` | `readonly` | `string` | - | [`PrimitiveClaim`](recipe-session#primitiveclaim).[`id`](recipe-session#id-2) | node\_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:8 |
| <a id="refresh"></a> `refresh` | `readonly` | (`userContext`) => `Promise`\<`void`\> | - | [`BooleanClaim`](recipe-session#booleanclaim).[`refresh`](recipe-session#refresh) | node\_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:9 |
| <a id="validators"></a> `validators` | `public` | `object` & `BooleanValidators` & `object` | [`BooleanClaim`](recipe-session#booleanclaim).[`validators`](recipe-session#validators) | - | [tmp/supertokens-web-js/lib/ts/recipe/emailverification/emailVerificationClaim.ts:82](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/emailVerificationClaim.ts#L82) |

#### Methods

##### getLastFetchedTime()

```ts check=false reason="Generated API signature"
getLastFetchedTime(payload, _userContext?): number;
```

Defined in: node\_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:13

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `payload` | `any` |
| `_userContext?` | `any` |

###### Returns

`number`

###### Inherited from

[`BooleanClaim`](recipe-session#booleanclaim).[`getLastFetchedTime`](recipe-session#getlastfetchedtime)

##### getValueFromPayload()

```ts check=false reason="Generated API signature"
getValueFromPayload(payload, _userContext?): boolean;
```

Defined in: node\_modules/supertokens-website/lib/build/claims/primitiveClaim.d.ts:12

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `payload` | `any` |
| `_userContext?` | `any` |

###### Returns

`boolean`

###### Inherited from

[`BooleanClaim`](recipe-session#booleanclaim).[`getValueFromPayload`](recipe-session#getvaluefrompayload)

## Variables

### EmailVerificationClaim

```ts check=false reason="Generated API signature"
const EmailVerificationClaim: EmailVerificationClaimClass = RecipeWrapper.EmailVerificationClaim;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:122](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L122)

***

### getEmailVerificationTokenFromURL()

```ts check=false reason="Generated API signature"
const getEmailVerificationTokenFromURL: (input?) => string = RecipeWrapper.getEmailVerificationTokenFromURL;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:120](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L120)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: `any`; \} |
| `input.userContext?` | `any` |

#### Returns

`string`

***

### getTenantIdFromURL()

```ts check=false reason="Generated API signature"
const getTenantIdFromURL: (input?) => string = RecipeWrapper.getTenantIdFromURL;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:121](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L121)

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()

```ts check=false reason="Generated API signature"
const init: (config?) => CreateRecipeFunction<PreAndPostAPIHookAction> = RecipeWrapper.init;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/emailverification/index.ts:116](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L116)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-emailverification-types#userinput) |

#### Returns

[`CreateRecipeFunction`](types#createrecipefunction)\<[`PreAndPostAPIHookAction`](recipe-emailverification-types#preandpostapihookaction)\>

***

### isEmailVerified()

```ts check=false reason="Generated API signature"
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](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L119)

Check if an email has been verified

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#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()

```ts check=false reason="Generated API signature"
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](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L118)

Send an email to the user for verification.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#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()

```ts check=false reason="Generated API signature"
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](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/emailverification/index.ts#L117)

Verify an email

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#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](recipe-emailverification-types#postapihookcontext)

***

### PreAPIHookContext

Re-exports [PreAPIHookContext](recipe-emailverification-types#preapihookcontext)

***

### RecipeFunctionOptions

Re-exports [RecipeFunctionOptions](recipe-emailpassword#recipefunctionoptions)

***

### RecipeInterface

Re-exports [RecipeInterface](recipe-emailverification-types#recipeinterface)

***

### UserInput

Re-exports [UserInput](recipe-emailverification-types#userinput)
