File length: 16154
# References - Frontend SDKs - React SDK Reference - EmailPassword
Source: https://supertokens.com/docs/references/frontend-sdks/supertokens-auth-react/recipe-emailpassword
## Classes
### default
Defined in: [recipe/emailpassword/index.ts:29](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L29)
#### Constructors
##### Constructor
```ts
new default(): default;
```
###### Returns
[`default`](#default)
#### Properties
| Property | Modifier | Type | Default value | Defined in |
| ------ | ------ | ------ | ------ | ------ |
| `ComponentsOverrideProvider` | `static` | `any` | `RecipeComponentsOverrideContextProvider` | [recipe/emailpassword/index.ts:192](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L192) |
#### Methods
##### doesEmailExist()
```ts
static doesEmailExist(input): Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}>;
```
Defined in: [recipe/emailpassword/index.ts:170](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L170)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `email`: `string`; `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.email` | `string` |
| `input.options?` | `RecipeFunctionOptions` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
###### Returns
`Promise`\<\{
`doesExist`: `boolean`;
`fetchResponse`: `Response`;
`status`: `"OK"`;
\}\>
##### getResetPasswordTokenFromURL()
```ts
static getResetPasswordTokenFromURL(input?): string;
```
Defined in: [recipe/emailpassword/index.ts:185](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L185)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
###### Returns
`string`
##### init()
```ts
static init(config?): any;
```
Defined in: [recipe/emailpassword/index.ts:30](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L30)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-emailpassword-types.mdx#userinput) |
###### Returns
`any`
##### sendPasswordResetEmail()
```ts
static sendPasswordResetEmail(input): Promise<
| {
fetchResponse: Response;
status: "OK" | "PASSWORD_RESET_NOT_ALLOWED";
}
| {
fetchResponse: Response;
formFields: object[];
status: "FIELD_ERROR";
}>;
```
Defined in: [recipe/emailpassword/index.ts:71](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L71)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `formFields`: `object`[]; `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.formFields` | `object`[] |
| `input.options?` | `RecipeFunctionOptions` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
###### Returns
`Promise`\<
\| \{
`fetchResponse`: `Response`;
`status`: `"OK"` \| `"PASSWORD_RESET_NOT_ALLOWED"`;
\}
\| \{
`fetchResponse`: `Response`;
`formFields`: `object`[];
`status`: `"FIELD_ERROR"`;
\}\>
##### signIn()
```ts
static signIn(input): Promise<
| {
fetchResponse: Response;
status: "OK";
user: User;
}
| {
fetchResponse: Response;
formFields: object[];
status: "FIELD_ERROR";
}
| {
fetchResponse: Response;
status: "WRONG_CREDENTIALS_ERROR";
}
| {
fetchResponse: Response;
reason: string;
status: "SIGN_IN_NOT_ALLOWED";
}>;
```
Defined in: [recipe/emailpassword/index.ts:132](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L132)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `formFields`: `object`[]; `options?`: `RecipeFunctionOptions`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.formFields` | `object`[] |
| `input.options?` | `RecipeFunctionOptions` |
| `input.shouldTryLinkingWithSessionUser?` | `boolean` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
###### Returns
`Promise`\<
\| \{
`fetchResponse`: `Response`;
`status`: `"OK"`;
`user`: `User`;
\}
\| \{
`fetchResponse`: `Response`;
`formFields`: `object`[];
`status`: `"FIELD_ERROR"`;
\}
\| \{
`fetchResponse`: `Response`;
`status`: `"WRONG_CREDENTIALS_ERROR"`;
\}
\| \{
`fetchResponse`: `Response`;
`reason`: `string`;
`status`: `"SIGN_IN_NOT_ALLOWED"`;
\}\>
##### signOut()
```ts
static signOut(input?): Promise;
```
Defined in: [recipe/emailpassword/index.ts:34](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L34)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
###### Returns
`Promise`\<`void`\>
##### signUp()
```ts
static signUp(input): Promise<
| {
fetchResponse: Response;
status: "OK";
user: User;
}
| {
fetchResponse: Response;
formFields: object[];
status: "FIELD_ERROR";
}
| {
fetchResponse: Response;
reason: string;
status: "SIGN_UP_NOT_ALLOWED";
}>;
```
Defined in: [recipe/emailpassword/index.ts:98](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L98)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `formFields`: `object`[]; `options?`: `RecipeFunctionOptions`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.formFields` | `object`[] |
| `input.options?` | `RecipeFunctionOptions` |
| `input.shouldTryLinkingWithSessionUser?` | `boolean` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
###### Returns
`Promise`\<
\| \{
`fetchResponse`: `Response`;
`status`: `"OK"`;
`user`: `User`;
\}
\| \{
`fetchResponse`: `Response`;
`formFields`: `object`[];
`status`: `"FIELD_ERROR"`;
\}
\| \{
`fetchResponse`: `Response`;
`reason`: `string`;
`status`: `"SIGN_UP_NOT_ALLOWED"`;
\}\>
##### submitNewPassword()
```ts
static submitNewPassword(input): Promise<
| {
fetchResponse: Response;
status: "OK";
}
| {
fetchResponse: Response;
status: "RESET_PASSWORD_INVALID_TOKEN_ERROR";
}
| {
fetchResponse: Response;
formFields: object[];
status: "FIELD_ERROR";
}>;
```
Defined in: [recipe/emailpassword/index.ts:40](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L40)
###### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `formFields`: `object`[]; `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.formFields` | `object`[] |
| `input.options?` | `RecipeFunctionOptions` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
###### Returns
`Promise`\<
\| \{
`fetchResponse`: `Response`;
`status`: `"OK"`;
\}
\| \{
`fetchResponse`: `Response`;
`status`: `"RESET_PASSWORD_INVALID_TOKEN_ERROR"`;
\}
\| \{
`fetchResponse`: `Response`;
`formFields`: `object`[];
`status`: `"FIELD_ERROR"`;
\}\>
## Variables
### doesEmailExist()
```ts
const doesEmailExist: (input) => Promise<{
doesExist: boolean;
fetchResponse: Response;
status: "OK";
}> = Wrapper.doesEmailExist;
```
Defined in: [recipe/emailpassword/index.ts:201](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L201)
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `email`: `string`; `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.email` | `string` |
| `input.options?` | `RecipeFunctionOptions` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
#### Returns
`Promise`\<\{
`doesExist`: `boolean`;
`fetchResponse`: `Response`;
`status`: `"OK"`;
\}\>
***
### EmailPasswordComponentsOverrideProvider
```ts
const EmailPasswordComponentsOverrideProvider: any = Wrapper.ComponentsOverrideProvider;
```
Defined in: [recipe/emailpassword/index.ts:203](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L203)
***
### getResetPasswordTokenFromURL()
```ts
const getResetPasswordTokenFromURL: (input?) => string = Wrapper.getResetPasswordTokenFromURL;
```
Defined in: [recipe/emailpassword/index.ts:202](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L202)
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
#### Returns
`string`
***
### init()
```ts
const init: (config?) => any = Wrapper.init;
```
Defined in: [recipe/emailpassword/index.ts:195](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L195)
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `config?` | [`UserInput`](recipe-emailpassword-types.mdx#userinput) |
#### Returns
`any`
***
### sendPasswordResetEmail()
```ts
const sendPasswordResetEmail: (input) => Promise<
| {
fetchResponse: Response;
status: "OK" | "PASSWORD_RESET_NOT_ALLOWED";
}
| {
fetchResponse: Response;
formFields: object[];
status: "FIELD_ERROR";
}> = Wrapper.sendPasswordResetEmail;
```
Defined in: [recipe/emailpassword/index.ts:198](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L198)
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `formFields`: `object`[]; `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.formFields` | `object`[] |
| `input.options?` | `RecipeFunctionOptions` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
#### Returns
`Promise`\<
\| \{
`fetchResponse`: `Response`;
`status`: `"OK"` \| `"PASSWORD_RESET_NOT_ALLOWED"`;
\}
\| \{
`fetchResponse`: `Response`;
`formFields`: `object`[];
`status`: `"FIELD_ERROR"`;
\}\>
***
### signIn()
```ts
const signIn: (input) => Promise<
| {
fetchResponse: Response;
status: "OK";
user: User;
}
| {
fetchResponse: Response;
formFields: object[];
status: "FIELD_ERROR";
}
| {
fetchResponse: Response;
status: "WRONG_CREDENTIALS_ERROR";
}
| {
fetchResponse: Response;
reason: string;
status: "SIGN_IN_NOT_ALLOWED";
}> = Wrapper.signIn;
```
Defined in: [recipe/emailpassword/index.ts:200](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L200)
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `formFields`: `object`[]; `options?`: `RecipeFunctionOptions`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.formFields` | `object`[] |
| `input.options?` | `RecipeFunctionOptions` |
| `input.shouldTryLinkingWithSessionUser?` | `boolean` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
#### Returns
`Promise`\<
\| \{
`fetchResponse`: `Response`;
`status`: `"OK"`;
`user`: `User`;
\}
\| \{
`fetchResponse`: `Response`;
`formFields`: `object`[];
`status`: `"FIELD_ERROR"`;
\}
\| \{
`fetchResponse`: `Response`;
`status`: `"WRONG_CREDENTIALS_ERROR"`;
\}
\| \{
`fetchResponse`: `Response`;
`reason`: `string`;
`status`: `"SIGN_IN_NOT_ALLOWED"`;
\}\>
***
### signOut()
```ts
const signOut: (input?) => Promise = Wrapper.signOut;
```
Defined in: [recipe/emailpassword/index.ts:196](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L196)
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
#### Returns
`Promise`\<`void`\>
***
### signUp()
```ts
const signUp: (input) => Promise<
| {
fetchResponse: Response;
status: "OK";
user: User;
}
| {
fetchResponse: Response;
formFields: object[];
status: "FIELD_ERROR";
}
| {
fetchResponse: Response;
reason: string;
status: "SIGN_UP_NOT_ALLOWED";
}> = Wrapper.signUp;
```
Defined in: [recipe/emailpassword/index.ts:199](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L199)
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `formFields`: `object`[]; `options?`: `RecipeFunctionOptions`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.formFields` | `object`[] |
| `input.options?` | `RecipeFunctionOptions` |
| `input.shouldTryLinkingWithSessionUser?` | `boolean` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
#### Returns
`Promise`\<
\| \{
`fetchResponse`: `Response`;
`status`: `"OK"`;
`user`: `User`;
\}
\| \{
`fetchResponse`: `Response`;
`formFields`: `object`[];
`status`: `"FIELD_ERROR"`;
\}
\| \{
`fetchResponse`: `Response`;
`reason`: `string`;
`status`: `"SIGN_UP_NOT_ALLOWED"`;
\}\>
***
### submitNewPassword()
```ts
const submitNewPassword: (input) => Promise<
| {
fetchResponse: Response;
status: "OK";
}
| {
fetchResponse: Response;
status: "RESET_PASSWORD_INVALID_TOKEN_ERROR";
}
| {
fetchResponse: Response;
formFields: object[];
status: "FIELD_ERROR";
}> = Wrapper.submitNewPassword;
```
Defined in: [recipe/emailpassword/index.ts:197](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/emailpassword/index.ts#L197)
#### Parameters
| Parameter | Type |
| ------ | ------ |
| `input` | \{ `formFields`: `object`[]; `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} |
| `input.formFields` | `object`[] |
| `input.options?` | `RecipeFunctionOptions` |
| `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) |
#### Returns
`Promise`\<
\| \{
`fetchResponse`: `Response`;
`status`: `"OK"`;
\}
\| \{
`fetchResponse`: `Response`;
`status`: `"RESET_PASSWORD_INVALID_TOKEN_ERROR"`;
\}
\| \{
`fetchResponse`: `Response`;
`formFields`: `object`[];
`status`: `"FIELD_ERROR"`;
\}\>
## References
### GetRedirectionURLContext
Re-exports [GetRedirectionURLContext](recipe-emailpassword-types.mdx#getredirectionurlcontext)
***
### OnHandleEventContext
Re-exports [OnHandleEventContext](recipe-emailpassword-types.mdx#onhandleeventcontext)
***
### PreAPIHookContext
Re-exports [PreAPIHookContext](recipe-emailpassword-types.mdx#preapihookcontext)
***
### RecipeInterface
Renames and re-exports [SuperTokensWrapper](index.mdx#supertokenswrapper-1)
***
### UserInput
Re-exports [UserInput](recipe-emailpassword-types.mdx#userinput)