---
title: supertokens-web-js/recipe/passwordless/types
description: References documentation for the supertokens-web-js/recipe/passwordless/types package
sidebar:
  order: 140
---

## Type Aliases

### InputType

```ts check=false reason="Generated API signature"
type InputType = RecipeConfig<PreAndPostAPIHookAction> & UserInput;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:49](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L49)

***

### NormalisedInputType

```ts check=false reason="Generated API signature"
type NormalisedInputType = NormalisedRecipeConfig<PreAndPostAPIHookAction> & object;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:51](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L51)

#### Type Declaration

| Name | Type | Defined in |
| ------ | ------ | ------ |
| `override` | `object` | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:52](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L52) |
| `override.functions()` | (`originalImplementation`, `builder`) => [`RecipeInterface`](#recipeinterface) | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:53](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L53) |

***

### PasswordlessFlowType

```ts check=false reason="Generated API signature"
type PasswordlessFlowType = "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK";
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:60](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L60)

***

### PostAPIHookContext

```ts check=false reason="Generated API signature"
type PostAPIHookContext = RecipePostAPIHookContext<PreAndPostAPIHookAction>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:35](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L35)

***

### PreAndPostAPIHookAction

```ts check=false reason="Generated API signature"
type PreAndPostAPIHookAction = 
  | "PASSWORDLESS_CREATE_CODE"
  | "PASSWORDLESS_CONSUME_CODE"
  | "PASSWORDLESS_RESEND_CODE"
  | "EMAIL_EXISTS"
  | "PHONE_NUMBER_EXISTS";
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:27](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L27)

***

### PreAPIHookContext

```ts check=false reason="Generated API signature"
type PreAPIHookContext = RecipePreAPIHookContext<PreAndPostAPIHookAction>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:34](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L34)

***

### RecipeInterface

```ts check=false reason="Generated API signature"
type RecipeInterface = object;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:62](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L62)

#### Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="clearloginattemptinfo"></a> `clearLoginAttemptInfo` | (`input`) => `Promise`\<`void`\> | Clear any information about login attempts from storage | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:312](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L312) |
| <a id="consumecode"></a> `consumeCode` | (`input`) => `Promise`\< \| \{ `createdNewRecipeUser`: `boolean`; `fetchResponse`: `Response`; `status`: `"OK"`; `user`: [`User`](types#user); \} \| \{ `failedCodeInputAttemptCount`: `number`; `fetchResponse`: `Response`; `maximumCodeInputAttempts`: `number`; `status`: `"INCORRECT_USER_INPUT_CODE_ERROR"` \| `"EXPIRED_USER_INPUT_CODE_ERROR"`; \} \| \{ `fetchResponse`: `Response`; `status`: `"RESTART_FLOW_ERROR"`; \} \| \{ `fetchResponse`: `Response`; `reason`: `string`; `status`: `"SIGN_IN_UP_NOT_ALLOWED"`; \}\> | Log the user in using the input code or link code **Throws** STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"` | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:168](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L168) |
| <a id="createcode"></a> `createCode` | (`input`) => `Promise`\< \| \{ `deviceId`: `string`; `fetchResponse`: `Response`; `flowType`: [`PasswordlessFlowType`](#passwordlessflowtype); `preAuthSessionId`: `string`; `status`: `"OK"`; \} \| \{ `fetchResponse`: `Response`; `reason`: `string`; `status`: `"SIGN_IN_UP_NOT_ALLOWED"`; \}\> | Create and send a code to the user for passwordless auth **Throws** STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"` | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:80](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L80) |
| <a id="doesemailexist"></a> `doesEmailExist` | (`input`) => `Promise`\<\{ `doesExist`: `boolean`; `fetchResponse`: `Response`; `status`: `"OK"`; \}\> | Check if a user with the given email exists **Throws** STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"` | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:244](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L244) |
| <a id="doesphonenumberexist"></a> `doesPhoneNumberExist` | (`input`) => `Promise`\<\{ `doesExist`: `boolean`; `fetchResponse`: `Response`; `status`: `"OK"`; \}\> | Check if a user with the given phone number exists **Throws** STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"` | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:263](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L263) |
| <a id="getlinkcodefromurl"></a> `getLinkCodeFromURL` | (`input`) => `string` | Reads and returns the link code from the current URL | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:211](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L211) |
| <a id="getloginattemptinfo"></a> `getLoginAttemptInfo` | \<`CustomLoginAttemptInfoProperties`\>(`input`) => `Promise`\<`undefined` \| `object` & `CustomLoginAttemptInfoProperties`\> | Get information about the current login attempt from storage | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:280](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L280) |
| <a id="getpreauthsessionidfromurl"></a> `getPreAuthSessionIdFromURL` | (`input`) => `string` | Reads and returns the pre auth session id from the current URL | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:229](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L229) |
| <a id="gettenantidfromurl"></a> `getTenantIdFromURL` | (`input`) => `string` \| `undefined` | Reads and returns the tenant id from the current URL | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:220](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L220) |
| <a id="resendcode"></a> `resendCode` | (`input`) => `Promise`\<\{ `fetchResponse`: `Response`; `status`: `"OK"` \| `"RESTART_FLOW_ERROR"`; \}\> | Resend the code to the user **Throws** STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"` | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:128](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L128) |
| <a id="setloginattemptinfo"></a> `setLoginAttemptInfo` | \<`CustomStateProperties`\>(`input`) => `Promise`\<`void`\> | Set information about the current login attempt to storage | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:296](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L296) |

***

### UserInput

```ts check=false reason="Generated API signature"
type UserInput = object & RecipeModuleUserInput<PreAndPostAPIHookAction>;
```

Defined in: [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:37](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L37)

#### Type Declaration

| Name | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `override?` | `object` | Refer to [the documentation](https://supertokens.com/docs/authentication/passwordless/hooks-and-overrides) | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:41](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L41) |
| `override.functions()?` | (`originalImplementation`, `builder`) => [`RecipeInterface`](#recipeinterface) | - | [tmp/supertokens-web-js/lib/ts/recipe/passwordless/types.ts:42](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/types.ts#L42) |
