---
title: supertokens-node/recipe/emailpassword
description: References documentation for the supertokens-node/recipe/emailpassword package
sidebar:
  order: 30
---

## Classes

### default

Defined in: [recipe/emailpassword/index.ts:27](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L27)

#### 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-error"></a> `Error` | `static` | *typeof* `default` | `SuperTokensError` | [recipe/emailpassword/index.ts:30](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L30) |
| <a id="member-default-init"></a> `init` | `static` | (`config?`) => [`RecipeListFunction`](types#recipelistfunction) | `Recipe.init` | [recipe/emailpassword/index.ts:28](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L28) |

#### Methods

##### consumePasswordResetToken()

```ts check=false reason="Generated API signature"
static consumePasswordResetToken(
   tenantId, 
   token, 
   userContext?): Promise<
  | {
  email: string;
  status: "OK";
  userId: string;
}
  | {
  status: "RESET_PASSWORD_INVALID_TOKEN_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:236](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L236)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `token` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `email`: `string`;
  `status`: `"OK"`;
  `userId`: `string`;
\}
  \| \{
  `status`: `"RESET_PASSWORD_INVALID_TOKEN_ERROR"`;
\}\>

##### createResetPasswordLink()

```ts check=false reason="Generated API signature"
static createResetPasswordLink(
   tenantId, 
   userId, 
   email, 
   userContext?): Promise<
  | {
  link: string;
  status: "OK";
}
  | {
  status: "UNKNOWN_USER_ID_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:280](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L280)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `userId` | `string` |
| `email` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `link`: `string`;
  `status`: `"OK"`;
\}
  \| \{
  `status`: `"UNKNOWN_USER_ID_ERROR"`;
\}\>

##### createResetPasswordToken()

```ts check=false reason="Generated API signature"
static createResetPasswordToken(
   tenantId, 
   userId, 
   email, 
   userContext?): Promise<
  | {
  status: "OK";
  token: string;
}
  | {
  status: "UNKNOWN_USER_ID_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:183](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L183)

We do not make email optional here cause we want to
allow passing in primaryUserId. If we make email optional,
and if the user provides a primaryUserId, then it may result in two problems:
 - there is no recipeUserId = input primaryUserId, in this case,
   this function will throw an error
 - There is a recipe userId = input primaryUserId, but that recipe has no email,
   or has wrong email compared to what the user wanted to generate a reset token for.

And we want to allow primaryUserId being passed in.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `userId` | `string` |
| `email` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `status`: `"OK"`;
  `token`: `string`;
\}
  \| \{
  `status`: `"UNKNOWN_USER_ID_ERROR"`;
\}\>

##### resetPasswordUsingToken()

```ts check=false reason="Generated API signature"
static resetPasswordUsingToken(
   tenantId, 
   token, 
   newPassword, 
   userContext?): Promise<
  | {
  status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR";
}
  | {
  failureReason: string;
  status: "PASSWORD_POLICY_VIOLATED_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:197](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L197)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `token` | `string` |
| `newPassword` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `status`: `"OK"` \| `"UNKNOWN_USER_ID_ERROR"` \| `"RESET_PASSWORD_INVALID_TOKEN_ERROR"`;
\}
  \| \{
  `failureReason`: `string`;
  `status`: `"PASSWORD_POLICY_VIOLATED_ERROR"`;
\}\>

##### sendEmail()

```ts check=false reason="Generated API signature"
static sendEmail(input): Promise<void>;
```

Defined in: [recipe/emailpassword/index.ts:343](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L343)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | [`TypeEmailPasswordPasswordResetEmailDeliveryInput`](recipe-emailpassword-types#typeemailpasswordpasswordresetemaildeliveryinput) & `object` |

###### Returns

`Promise`\<`void`\>

##### sendResetPasswordEmail()

```ts check=false reason="Generated API signature"
static sendResetPasswordEmail(
   tenantId, 
   userId, 
   email, 
   userContext?): Promise<{
  status: "OK" | "UNKNOWN_USER_ID_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:305](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L305)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `userId` | `string` |
| `email` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<\{
  `status`: `"OK"` \| `"UNKNOWN_USER_ID_ERROR"`;
\}\>

##### signIn()

###### Call Signature

```ts check=false reason="Generated API signature"
static signIn(
   tenantId, 
   email, 
   password, 
   session?, 
   userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "WRONG_CREDENTIALS_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:100](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L100)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `session?` | `undefined` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1);
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `status`: `"WRONG_CREDENTIALS_ERROR"`;
\}\>

###### Call Signature

```ts check=false reason="Generated API signature"
static signIn(
   tenantId, 
   email, 
   password, 
   session, 
   userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "WRONG_CREDENTIALS_ERROR";
}
  | {
  reason:   | "EMAIL_VERIFICATION_REQUIRED"
     | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
  status: "LINKING_TO_SESSION_USER_FAILED";
}>;
```

Defined in: [recipe/emailpassword/index.ts:107](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L107)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `session` | `SessionContainerInterface` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1);
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `status`: `"WRONG_CREDENTIALS_ERROR"`;
\}
  \| \{
  `reason`:   \| `"EMAIL_VERIFICATION_REQUIRED"`
     \| `"RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`
     \| `"ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`
     \| `"SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`;
  `status`: `"LINKING_TO_SESSION_USER_FAILED"`;
\}\>

##### signUp()

###### Call Signature

```ts check=false reason="Generated API signature"
static signUp(
   tenantId, 
   email, 
   password, 
   session?, 
   userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:32](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L32)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `session?` | `undefined` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1);
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `status`: `"EMAIL_ALREADY_EXISTS_ERROR"`;
\}\>

###### Call Signature

```ts check=false reason="Generated API signature"
static signUp(
   tenantId, 
   email, 
   password, 
   session, 
   userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}
  | {
  reason:   | "EMAIL_VERIFICATION_REQUIRED"
     | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
  status: "LINKING_TO_SESSION_USER_FAILED";
}>;
```

Defined in: [recipe/emailpassword/index.ts:46](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L46)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `session` | `SessionContainerInterface` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1);
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `status`: `"EMAIL_ALREADY_EXISTS_ERROR"`;
\}
  \| \{
  `reason`:   \| `"EMAIL_VERIFICATION_REQUIRED"`
     \| `"RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`
     \| `"ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`
     \| `"SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`;
  `status`: `"LINKING_TO_SESSION_USER_FAILED"`;
\}\>

##### updateEmailOrPassword()

```ts check=false reason="Generated API signature"
static updateEmailOrPassword(input): Promise<
  | {
  status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR";
}
  | {
  reason: string;
  status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR";
}
  | {
  failureReason: string;
  status: "PASSWORD_POLICY_VIOLATED_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:255](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L255)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `applyPasswordPolicy?`: `boolean`; `email?`: `string`; `password?`: `string`; `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1); `tenantIdForPasswordPolicy?`: `string`; `userContext?`: `Record`\<`string`, `any`\>; \} |
| `input.applyPasswordPolicy?` | `boolean` |
| `input.email?` | `string` |
| `input.password?` | `string` |
| `input.recipeUserId` | [`RecipeUserId`](index#recipeuserid-1) |
| `input.tenantIdForPasswordPolicy?` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<
  \| \{
  `status`: `"OK"` \| `"EMAIL_ALREADY_EXISTS_ERROR"` \| `"UNKNOWN_USER_ID_ERROR"`;
\}
  \| \{
  `reason`: `string`;
  `status`: `"EMAIL_CHANGE_NOT_ALLOWED_ERROR"`;
\}
  \| \{
  `failureReason`: `string`;
  `status`: `"PASSWORD_POLICY_VIOLATED_ERROR"`;
\}\>

##### verifyCredentials()

```ts check=false reason="Generated API signature"
static verifyCredentials(
   tenantId, 
   email, 
   password, 
   userContext?): Promise<{
  status: "OK" | "WRONG_CREDENTIALS_ERROR";
}>;
```

Defined in: [recipe/emailpassword/index.ts:153](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L153)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

###### Returns

`Promise`\<\{
  `status`: `"OK"` \| `"WRONG_CREDENTIALS_ERROR"`;
\}\>

## Variables

### consumePasswordResetToken()

```ts check=false reason="Generated API signature"
consumePasswordResetToken: (tenantId, token, userContext?) => Promise<
  | {
  email: string;
  status: "OK";
  userId: string;
}
  | {
  status: "RESET_PASSWORD_INVALID_TOKEN_ERROR";
}> = Wrapper.consumePasswordResetToken;
```

Defined in: [recipe/emailpassword/index.ts:369](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L369)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `token` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<
  \| \{
  `email`: `string`;
  `status`: `"OK"`;
  `userId`: `string`;
\}
  \| \{
  `status`: `"RESET_PASSWORD_INVALID_TOKEN_ERROR"`;
\}\>

***

### createResetPasswordLink()

```ts check=false reason="Generated API signature"
createResetPasswordLink: (tenantId, userId, email, userContext?) => Promise<
  | {
  link: string;
  status: "OK";
}
  | {
  status: "UNKNOWN_USER_ID_ERROR";
}> = Wrapper.createResetPasswordLink;
```

Defined in: [recipe/emailpassword/index.ts:375](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L375)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `userId` | `string` |
| `email` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<
  \| \{
  `link`: `string`;
  `status`: `"OK"`;
\}
  \| \{
  `status`: `"UNKNOWN_USER_ID_ERROR"`;
\}\>

***

### createResetPasswordToken()

```ts check=false reason="Generated API signature"
createResetPasswordToken: (tenantId, userId, email, userContext?) => Promise<
  | {
  status: "OK";
  token: string;
}
  | {
  status: "UNKNOWN_USER_ID_ERROR";
}> = Wrapper.createResetPasswordToken;
```

Defined in: [recipe/emailpassword/index.ts:365](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L365)

We do not make email optional here cause we want to
allow passing in primaryUserId. If we make email optional,
and if the user provides a primaryUserId, then it may result in two problems:
 - there is no recipeUserId = input primaryUserId, in this case,
   this function will throw an error
 - There is a recipe userId = input primaryUserId, but that recipe has no email,
   or has wrong email compared to what the user wanted to generate a reset token for.

And we want to allow primaryUserId being passed in.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `userId` | `string` |
| `email` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<
  \| \{
  `status`: `"OK"`;
  `token`: `string`;
\}
  \| \{
  `status`: `"UNKNOWN_USER_ID_ERROR"`;
\}\>

***

### Error

```ts check=false reason="Generated API signature"
Error: typeof default = Wrapper.Error;
```

Defined in: [recipe/emailpassword/index.ts:357](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L357)

***

### init()

```ts check=false reason="Generated API signature"
init: (config?) => RecipeListFunction = Wrapper.init;
```

Defined in: [recipe/emailpassword/index.ts:355](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L355)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `config?` | [`TypeInput`](recipe-emailpassword-types#typeinput) |

#### Returns

[`RecipeListFunction`](types#recipelistfunction)

***

### resetPasswordUsingToken()

```ts check=false reason="Generated API signature"
resetPasswordUsingToken: (tenantId, token, newPassword, userContext?) => Promise<
  | {
  status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR";
}
  | {
  failureReason: string;
  status: "PASSWORD_POLICY_VIOLATED_ERROR";
}> = Wrapper.resetPasswordUsingToken;
```

Defined in: [recipe/emailpassword/index.ts:367](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L367)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `token` | `string` |
| `newPassword` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<
  \| \{
  `status`: `"OK"` \| `"UNKNOWN_USER_ID_ERROR"` \| `"RESET_PASSWORD_INVALID_TOKEN_ERROR"`;
\}
  \| \{
  `failureReason`: `string`;
  `status`: `"PASSWORD_POLICY_VIOLATED_ERROR"`;
\}\>

***

### sendEmail()

```ts check=false reason="Generated API signature"
sendEmail: (input) => Promise<void> = Wrapper.sendEmail;
```

Defined in: [recipe/emailpassword/index.ts:379](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L379)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | [`TypeEmailPasswordPasswordResetEmailDeliveryInput`](recipe-emailpassword-types#typeemailpasswordpasswordresetemaildeliveryinput) & `object` |

#### Returns

`Promise`\<`void`\>

***

### sendResetPasswordEmail()

```ts check=false reason="Generated API signature"
sendResetPasswordEmail: (tenantId, userId, email, userContext?) => Promise<{
  status: "OK" | "UNKNOWN_USER_ID_ERROR";
}> = Wrapper.sendResetPasswordEmail;
```

Defined in: [recipe/emailpassword/index.ts:377](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L377)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `userId` | `string` |
| `email` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<\{
  `status`: `"OK"` \| `"UNKNOWN_USER_ID_ERROR"`;
\}\>

***

### signIn()

```ts check=false reason="Generated API signature"
signIn: {
  (tenantId, email, password, session?, userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "WRONG_CREDENTIALS_ERROR";
}>;
  (tenantId, email, password, session, userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "WRONG_CREDENTIALS_ERROR";
}
  | {
  reason:   | "EMAIL_VERIFICATION_REQUIRED"
     | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
  status: "LINKING_TO_SESSION_USER_FAILED";
}>;
} = Wrapper.signIn;
```

Defined in: [recipe/emailpassword/index.ts:361](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L361)

#### Call Signature

```ts check=false reason="Generated API signature"
(
   tenantId, 
   email, 
   password, 
   session?, 
   userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "WRONG_CREDENTIALS_ERROR";
}>;
```

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `session?` | `undefined` |
| `userContext?` | `Record`\<`string`, `any`\> |

##### Returns

`Promise`\<
  \| \{
  `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1);
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `status`: `"WRONG_CREDENTIALS_ERROR"`;
\}\>

#### Call Signature

```ts check=false reason="Generated API signature"
(
   tenantId, 
   email, 
   password, 
   session, 
   userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "WRONG_CREDENTIALS_ERROR";
}
  | {
  reason:   | "EMAIL_VERIFICATION_REQUIRED"
     | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
  status: "LINKING_TO_SESSION_USER_FAILED";
}>;
```

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `session` | `SessionContainerInterface` |
| `userContext?` | `Record`\<`string`, `any`\> |

##### Returns

`Promise`\<
  \| \{
  `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1);
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `status`: `"WRONG_CREDENTIALS_ERROR"`;
\}
  \| \{
  `reason`:   \| `"EMAIL_VERIFICATION_REQUIRED"`
     \| `"RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`
     \| `"ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`
     \| `"SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`;
  `status`: `"LINKING_TO_SESSION_USER_FAILED"`;
\}\>

***

### signUp()

```ts check=false reason="Generated API signature"
signUp: {
  (tenantId, email, password, session?, userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}>;
  (tenantId, email, password, session, userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}
  | {
  reason:   | "EMAIL_VERIFICATION_REQUIRED"
     | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
  status: "LINKING_TO_SESSION_USER_FAILED";
}>;
} = Wrapper.signUp;
```

Defined in: [recipe/emailpassword/index.ts:359](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L359)

#### Call Signature

```ts check=false reason="Generated API signature"
(
   tenantId, 
   email, 
   password, 
   session?, 
   userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}>;
```

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `session?` | `undefined` |
| `userContext?` | `Record`\<`string`, `any`\> |

##### Returns

`Promise`\<
  \| \{
  `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1);
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `status`: `"EMAIL_ALREADY_EXISTS_ERROR"`;
\}\>

#### Call Signature

```ts check=false reason="Generated API signature"
(
   tenantId, 
   email, 
   password, 
   session, 
   userContext?): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}
  | {
  reason:   | "EMAIL_VERIFICATION_REQUIRED"
     | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
     | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
  status: "LINKING_TO_SESSION_USER_FAILED";
}>;
```

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `session` | `SessionContainerInterface` |
| `userContext?` | `Record`\<`string`, `any`\> |

##### Returns

`Promise`\<
  \| \{
  `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1);
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `status`: `"EMAIL_ALREADY_EXISTS_ERROR"`;
\}
  \| \{
  `reason`:   \| `"EMAIL_VERIFICATION_REQUIRED"`
     \| `"RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`
     \| `"ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`
     \| `"SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"`;
  `status`: `"LINKING_TO_SESSION_USER_FAILED"`;
\}\>

***

### updateEmailOrPassword()

```ts check=false reason="Generated API signature"
updateEmailOrPassword: (input) => Promise<
  | {
  status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR";
}
  | {
  reason: string;
  status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR";
}
  | {
  failureReason: string;
  status: "PASSWORD_POLICY_VIOLATED_ERROR";
}> = Wrapper.updateEmailOrPassword;
```

Defined in: [recipe/emailpassword/index.ts:371](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L371)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `applyPasswordPolicy?`: `boolean`; `email?`: `string`; `password?`: `string`; `recipeUserId`: [`RecipeUserId`](index#recipeuserid-1); `tenantIdForPasswordPolicy?`: `string`; `userContext?`: `Record`\<`string`, `any`\>; \} |
| `input.applyPasswordPolicy?` | `boolean` |
| `input.email?` | `string` |
| `input.password?` | `string` |
| `input.recipeUserId` | [`RecipeUserId`](index#recipeuserid-1) |
| `input.tenantIdForPasswordPolicy?` | `string` |
| `input.userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<
  \| \{
  `status`: `"OK"` \| `"EMAIL_ALREADY_EXISTS_ERROR"` \| `"UNKNOWN_USER_ID_ERROR"`;
\}
  \| \{
  `reason`: `string`;
  `status`: `"EMAIL_CHANGE_NOT_ALLOWED_ERROR"`;
\}
  \| \{
  `failureReason`: `string`;
  `status`: `"PASSWORD_POLICY_VIOLATED_ERROR"`;
\}\>

***

### verifyCredentials()

```ts check=false reason="Generated API signature"
verifyCredentials: (tenantId, email, password, userContext?) => Promise<{
  status: "OK" | "WRONG_CREDENTIALS_ERROR";
}> = Wrapper.verifyCredentials;
```

Defined in: [recipe/emailpassword/index.ts:363](https://github.com/supertokens/supertokens-node/blob/8353a9a70d8b17dd9ff6ffe41201fa2ef0e60218/lib/ts/recipe/emailpassword/index.ts#L363)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `tenantId` | `string` |
| `email` | `string` |
| `password` | `string` |
| `userContext?` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<\{
  `status`: `"OK"` \| `"WRONG_CREDENTIALS_ERROR"`;
\}\>

## References

### APIInterface

Re-exports [APIInterface](recipe-emailpassword-types#apiinterface)

***

### APIOptions

Re-exports [APIOptions](recipe-emailpassword-types#apioptions)

***

### RecipeInterface

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