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

## Classes

### default

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

#### Constructors

##### Constructor

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

###### Returns

[`default`](#default)

#### Methods

##### clearLoginAttemptInfo()

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

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

Clear any information about login attempts from storage

###### Parameters

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

###### Returns

`Promise`\<`void`\>

##### consumeCode()

```ts check=false reason="Generated API signature"
static consumeCode(input?): Promise<
  | {
  createdNewRecipeUser: boolean;
  fetchResponse: Response;
  status: "OK";
  user: 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";
}>;
```

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

Log the user in using the input code or link code

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \| \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; `userInputCode`: `string`; \} \| \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |

###### Returns

`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"`;
\}\>

`{status: "OK", user, createdNewRecipeUser: bool}` if succesful

###### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

##### createCode()

```ts check=false reason="Generated API signature"
static createCode(input): Promise<
  | {
  deviceId: string;
  fetchResponse: Response;
  flowType: PasswordlessFlowType;
  preAuthSessionId: string;
  status: "OK";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_IN_UP_NOT_ALLOWED";
}>;
```

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

Create and send a code to the user for passwordless auth

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \| \{ `email`: `string`; `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: `any`; \} \| \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `phoneNumber`: `string`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: `any`; \} |

###### Returns

`Promise`\<
  \| \{
  `deviceId`: `string`;
  `fetchResponse`: `Response`;
  `flowType`: [`PasswordlessFlowType`](recipe-passwordless-types#passwordlessflowtype);
  `preAuthSessionId`: `string`;
  `status`: `"OK"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_IN_UP_NOT_ALLOWED"`;
\}\>

`{status: "OK", deviceId, preAuthSessionId, flowType}` If successful

###### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

##### doesEmailExist()

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

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

Check if a user with the given email exists

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `email`: `string`; `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.email` | `string` |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions) |
| `input.userContext?` | `any` |

###### Returns

`Promise`\<\{
  `doesExist`: `boolean`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}\>

`{status: "OK", doesExist: boolean}`

###### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

##### doesPhoneNumberExist()

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

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

Check if a user with the given phone number exists

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `phoneNumber`: `string`; `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions) |
| `input.phoneNumber` | `string` |
| `input.userContext?` | `any` |

###### Returns

`Promise`\<\{
  `doesExist`: `boolean`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}\>

`{status: "OK", doesExist: boolean}`

###### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

##### getLinkCodeFromURL()

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

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

Reads and returns the link code from the current URL

###### Parameters

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

###### Returns

`string`

The hash (#) property of the current URL

##### getLoginAttemptInfo()

```ts check=false reason="Generated API signature"
static getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?): Promise<object & CustomLoginAttemptInfoProperties>;
```

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

Get information about the current login attempt from storage

###### Type Parameters

| Type Parameter |
| ------ |
| `CustomLoginAttemptInfoProperties` |

###### Parameters

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

###### Returns

`Promise`\<`object` & `CustomLoginAttemptInfoProperties`\>

`{deviceId, preAuthSessionId, flowType}` if present, returns undefined otherwise

##### getPreAuthSessionIdFromURL()

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

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

Reads and returns the pre auth session id from the current URL

###### Parameters

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

###### Returns

`string`

The "preAuthSessionId" query parameter from the current URL

##### getTenantIdFromURL()

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

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

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/passwordless/index.ts:31](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/index.ts#L31)

###### Parameters

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

###### Returns

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

##### resendCode()

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

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

Resend the code to the user

###### 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"` \| `"RESTART_FLOW_ERROR"`;
\}\>

`{status: "OK"}` if succesful

###### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

##### setLoginAttemptInfo()

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

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

Set information about the current login attempt to storage

###### Type Parameters

| Type Parameter |
| ------ |
| `CustomStateProperties` |

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `attemptInfo`: `object` & `CustomStateProperties`; `userContext?`: `any`; \} |
| `input.attemptInfo` | `object` & `CustomStateProperties` |
| `input.userContext?` | `any` |

###### Returns

`Promise`\<`void`\>

##### signOut()

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

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

###### Parameters

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

###### Returns

`Promise`\<`void`\>

## Variables

### clearLoginAttemptInfo()

```ts check=false reason="Generated API signature"
const clearLoginAttemptInfo: (input?) => Promise<void> = RecipeWrapper.clearLoginAttemptInfo;
```

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

Clear any information about login attempts from storage

#### Parameters

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

#### Returns

`Promise`\<`void`\>

***

### consumeCode()

```ts check=false reason="Generated API signature"
const consumeCode: (input?) => Promise<
  | {
  createdNewRecipeUser: boolean;
  fetchResponse: Response;
  status: "OK";
  user: 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";
}> = RecipeWrapper.consumeCode;
```

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

Log the user in using the input code or link code

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input?` | \| \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; `userInputCode`: `string`; \} \| \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |

#### Returns

`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"`;
\}\>

`{status: "OK", user, createdNewRecipeUser: bool}` if succesful

#### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

***

### createCode()

```ts check=false reason="Generated API signature"
const createCode: (input) => Promise<
  | {
  deviceId: string;
  fetchResponse: Response;
  flowType: PasswordlessFlowType;
  preAuthSessionId: string;
  status: "OK";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_IN_UP_NOT_ALLOWED";
}> = RecipeWrapper.createCode;
```

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

Create and send a code to the user for passwordless auth

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \| \{ `email`: `string`; `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: `any`; \} \| \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `phoneNumber`: `string`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: `any`; \} |

#### Returns

`Promise`\<
  \| \{
  `deviceId`: `string`;
  `fetchResponse`: `Response`;
  `flowType`: [`PasswordlessFlowType`](recipe-passwordless-types#passwordlessflowtype);
  `preAuthSessionId`: `string`;
  `status`: `"OK"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_IN_UP_NOT_ALLOWED"`;
\}\>

`{status: "OK", deviceId, preAuthSessionId, flowType}` If successful

#### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

***

### doesEmailExist()

```ts check=false reason="Generated API signature"
const doesEmailExist: (input) => Promise<{
  doesExist: boolean;
  fetchResponse: Response;
  status: "OK";
}> = RecipeWrapper.doesEmailExist;
```

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

Check if a user with the given email exists

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `email`: `string`; `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `userContext?`: `any`; \} |
| `input.email` | `string` |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions) |
| `input.userContext?` | `any` |

#### Returns

`Promise`\<\{
  `doesExist`: `boolean`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}\>

`{status: "OK", doesExist: boolean}`

#### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

***

### doesPhoneNumberExist()

```ts check=false reason="Generated API signature"
const doesPhoneNumberExist: (input) => Promise<{
  doesExist: boolean;
  fetchResponse: Response;
  status: "OK";
}> = RecipeWrapper.doesPhoneNumberExist;
```

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

Check if a user with the given phone number exists

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `options?`: [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions); `phoneNumber`: `string`; `userContext?`: `any`; \} |
| `input.options?` | [`RecipeFunctionOptions`](recipe-emailpassword#recipefunctionoptions) |
| `input.phoneNumber` | `string` |
| `input.userContext?` | `any` |

#### Returns

`Promise`\<\{
  `doesExist`: `boolean`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}\>

`{status: "OK", doesExist: boolean}`

#### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

***

### getLinkCodeFromURL()

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

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

Reads and returns the link code from the current URL

#### Parameters

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

#### Returns

`string`

The hash (#) property of the current URL

***

### getLoginAttemptInfo()

```ts check=false reason="Generated API signature"
const getLoginAttemptInfo: <CustomLoginAttemptInfoProperties>(input?) => Promise<object & CustomLoginAttemptInfoProperties> = RecipeWrapper.getLoginAttemptInfo;
```

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

Get information about the current login attempt from storage

#### Type Parameters

| Type Parameter |
| ------ |
| `CustomLoginAttemptInfoProperties` |

#### Parameters

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

#### Returns

`Promise`\<`object` & `CustomLoginAttemptInfoProperties`\>

`{deviceId, preAuthSessionId, flowType}` if present, returns undefined otherwise

***

### getPreAuthSessionIdFromURL()

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

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

Reads and returns the pre auth session id from the current URL

#### Parameters

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

#### Returns

`string`

The "preAuthSessionId" query parameter from the current URL

***

### getTenantIdFromURL()

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

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

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/passwordless/index.ts:446](https://github.com/supertokens/supertokens-web-js/blob/be2e0fd7dcade8352cdc9639abe968e5cda5b1cd/lib/ts/recipe/passwordless/index.ts#L446)

#### Parameters

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

#### Returns

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

***

### resendCode()

```ts check=false reason="Generated API signature"
const resendCode: (input?) => Promise<{
  fetchResponse: Response;
  status: "OK" | "RESTART_FLOW_ERROR";
}> = RecipeWrapper.resendCode;
```

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

Resend the code to the user

#### 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"` \| `"RESTART_FLOW_ERROR"`;
\}\>

`{status: "OK"}` if succesful

#### Throws

STGeneralError if the API exposed by the backend SDKs returns `status: "GENERAL_ERROR"`

***

### setLoginAttemptInfo()

```ts check=false reason="Generated API signature"
const setLoginAttemptInfo: <CustomStateProperties>(input) => Promise<void> = RecipeWrapper.setLoginAttemptInfo;
```

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

Set information about the current login attempt to storage

#### Type Parameters

| Type Parameter |
| ------ |
| `CustomStateProperties` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `attemptInfo`: `object` & `CustomStateProperties`; `userContext?`: `any`; \} |
| `input.attemptInfo` | `object` & `CustomStateProperties` |
| `input.userContext?` | `any` |

#### Returns

`Promise`\<`void`\>

***

### signOut()

```ts check=false reason="Generated API signature"
const signOut: (input?) => Promise<void> = RecipeWrapper.signOut;
```

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

#### Parameters

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

#### Returns

`Promise`\<`void`\>

## References

### PostAPIHookContext

Re-exports [PostAPIHookContext](recipe-passwordless-types#postapihookcontext)

***

### PreAndPostAPIHookAction

Re-exports [PreAndPostAPIHookAction](recipe-passwordless-types#preandpostapihookaction)

***

### PreAPIHookContext

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

***

### RecipeFunctionOptions

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

***

### RecipeInterface

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

***

### UserInput

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