File length: 20065 # References - Frontend SDKs - React SDK Reference - Passwordless Source: https://supertokens.com/docs/references/frontend-sdks/supertokens-auth-react/recipe-passwordless ## Classes ### default Defined in: [recipe/passwordless/index.ts:30](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L30) #### Constructors ##### Constructor ```ts new default(): default; ``` ###### Returns [`default`](#default) #### Properties | Property | Modifier | Type | Default value | Defined in | | ------ | ------ | ------ | ------ | ------ | | `ComponentsOverrideProvider` | `static` | `any` | `RecipeComponentsOverrideContextProvider` | [recipe/passwordless/index.ts:196](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L196) | #### Methods ##### clearLoginAttemptInfo() ```ts static clearLoginAttemptInfo(input?): Promise; ``` Defined in: [recipe/passwordless/index.ts:189](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L189) ###### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | ###### Returns `Promise`\<`void`\> ##### consumeCode() ```ts 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: [recipe/passwordless/index.ts:84](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L84) ###### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \| \{ `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); `userInputCode`: `string`; \} \| \{ `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | ###### Returns `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"`; \}\> ##### createCode() ```ts static createCode(input): Promise< | { deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK"; } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; }>; ``` Defined in: [recipe/passwordless/index.ts:41](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L41) ###### Parameters | Parameter | Type | | ------ | ------ | | `input` | \| \{ `email`: `string`; `options?`: `RecipeFunctionOptions`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} \| \{ `options?`: `RecipeFunctionOptions`; `phoneNumber`: `string`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | ###### Returns `Promise`\< \| \{ `deviceId`: `string`; `fetchResponse`: `Response`; `flowType`: `PasswordlessFlowType`; `preAuthSessionId`: `string`; `status`: `"OK"`; \} \| \{ `reason`: `string`; `status`: `"SIGN_IN_UP_NOT_ALLOWED"`; \}\> ##### doesEmailExist() ```ts static doesEmailExist(input): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }>; ``` Defined in: [recipe/passwordless/index.ts:131](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L131) ###### 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"`; \}\> ##### doesPhoneNumberExist() ```ts static doesPhoneNumberExist(input): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }>; ``` Defined in: [recipe/passwordless/index.ts:146](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L146) ###### Parameters | Parameter | Type | | ------ | ------ | | `input` | \{ `options?`: `RecipeFunctionOptions`; `phoneNumber`: `string`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.options?` | `RecipeFunctionOptions` | | `input.phoneNumber` | `string` | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | ###### Returns `Promise`\<\{ `doesExist`: `boolean`; `fetchResponse`: `Response`; `status`: `"OK"`; \}\> ##### getLinkCodeFromURL() ```ts static getLinkCodeFromURL(input?): string; ``` Defined in: [recipe/passwordless/index.ts:117](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L117) ###### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | ###### Returns `string` ##### getLoginAttemptInfo() ```ts static getLoginAttemptInfo(input?): Promise; ``` Defined in: [recipe/passwordless/index.ts:161](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L161) ###### Type Parameters | Type Parameter | | ------ | | `CustomLoginAttemptInfoProperties` | ###### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | ###### Returns `Promise`\<`object` & `CustomLoginAttemptInfoProperties`\> ##### getPreAuthSessionIdFromURL() ```ts static getPreAuthSessionIdFromURL(input?): string; ``` Defined in: [recipe/passwordless/index.ts:124](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L124) ###### 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/passwordless/index.ts:31](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L31) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`UserInput`](recipe-passwordless-types.mdx#userinput) | ###### Returns `any` ##### resendCode() ```ts static resendCode(input?): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR"; }>; ``` Defined in: [recipe/passwordless/index.ts:74](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L74) ###### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.options?` | `RecipeFunctionOptions` | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | ###### Returns `Promise`\<\{ `fetchResponse`: `Response`; `status`: `"OK"` \| `"RESTART_FLOW_ERROR"`; \}\> ##### setLoginAttemptInfo() ```ts static setLoginAttemptInfo(input): Promise; ``` Defined in: [recipe/passwordless/index.ts:175](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L175) ###### Type Parameters | Type Parameter | | ------ | | `CustomStateProperties` | ###### Parameters | Parameter | Type | | ------ | ------ | | `input` | \{ `attemptInfo`: `object` & `CustomStateProperties`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.attemptInfo` | `object` & `CustomStateProperties` | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | ###### Returns `Promise`\<`void`\> ##### signOut() ```ts static signOut(input?): Promise; ``` Defined in: [recipe/passwordless/index.ts:35](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L35) ###### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | ###### Returns `Promise`\<`void`\> ## Variables ### clearLoginAttemptInfo() ```ts const clearLoginAttemptInfo: (input?) => Promise = Wrapper.clearLoginAttemptInfo; ``` Defined in: [recipe/passwordless/index.ts:209](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L209) #### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | #### Returns `Promise`\<`void`\> *** ### consumeCode() ```ts 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"; }> = Wrapper.consumeCode; ``` Defined in: [recipe/passwordless/index.ts:202](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L202) #### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \| \{ `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); `userInputCode`: `string`; \} \| \{ `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | #### Returns `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"`; \}\> *** ### createCode() ```ts const createCode: (input) => Promise< | { deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK"; } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED"; }> = Wrapper.createCode; ``` Defined in: [recipe/passwordless/index.ts:200](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L200) #### Parameters | Parameter | Type | | ------ | ------ | | `input` | \| \{ `email`: `string`; `options?`: `RecipeFunctionOptions`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} \| \{ `options?`: `RecipeFunctionOptions`; `phoneNumber`: `string`; `shouldTryLinkingWithSessionUser?`: `boolean`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | #### Returns `Promise`\< \| \{ `deviceId`: `string`; `fetchResponse`: `Response`; `flowType`: `PasswordlessFlowType`; `preAuthSessionId`: `string`; `status`: `"OK"`; \} \| \{ `reason`: `string`; `status`: `"SIGN_IN_UP_NOT_ALLOWED"`; \}\> *** ### doesEmailExist() ```ts const doesEmailExist: (input) => Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }> = Wrapper.doesEmailExist; ``` Defined in: [recipe/passwordless/index.ts:205](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L205) #### 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"`; \}\> *** ### doesPhoneNumberExist() ```ts const doesPhoneNumberExist: (input) => Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK"; }> = Wrapper.doesPhoneNumberExist; ``` Defined in: [recipe/passwordless/index.ts:206](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L206) #### Parameters | Parameter | Type | | ------ | ------ | | `input` | \{ `options?`: `RecipeFunctionOptions`; `phoneNumber`: `string`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.options?` | `RecipeFunctionOptions` | | `input.phoneNumber` | `string` | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | #### Returns `Promise`\<\{ `doesExist`: `boolean`; `fetchResponse`: `Response`; `status`: `"OK"`; \}\> *** ### getLinkCodeFromURL() ```ts const getLinkCodeFromURL: (input?) => string = Wrapper.getLinkCodeFromURL; ``` Defined in: [recipe/passwordless/index.ts:203](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L203) #### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | #### Returns `string` *** ### getLoginAttemptInfo() ```ts const getLoginAttemptInfo: (input?) => Promise = Wrapper.getLoginAttemptInfo; ``` Defined in: [recipe/passwordless/index.ts:207](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L207) #### Type Parameters | Type Parameter | | ------ | | `CustomLoginAttemptInfoProperties` | #### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | #### Returns `Promise`\<`object` & `CustomLoginAttemptInfoProperties`\> *** ### getPreAuthSessionIdFromURL() ```ts const getPreAuthSessionIdFromURL: (input?) => string = Wrapper.getPreAuthSessionIdFromURL; ``` Defined in: [recipe/passwordless/index.ts:204](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L204) #### 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/passwordless/index.ts:199](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L199) #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`UserInput`](recipe-passwordless-types.mdx#userinput) | #### Returns `any` *** ### PasswordlessComponentsOverrideProvider ```ts const PasswordlessComponentsOverrideProvider: any = Wrapper.ComponentsOverrideProvider; ``` Defined in: [recipe/passwordless/index.ts:211](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L211) *** ### resendCode() ```ts const resendCode: (input?) => Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR"; }> = Wrapper.resendCode; ``` Defined in: [recipe/passwordless/index.ts:201](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L201) #### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `options?`: `RecipeFunctionOptions`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.options?` | `RecipeFunctionOptions` | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | #### Returns `Promise`\<\{ `fetchResponse`: `Response`; `status`: `"OK"` \| `"RESTART_FLOW_ERROR"`; \}\> *** ### setLoginAttemptInfo() ```ts const setLoginAttemptInfo: (input) => Promise = Wrapper.setLoginAttemptInfo; ``` Defined in: [recipe/passwordless/index.ts:208](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L208) #### Type Parameters | Type Parameter | | ------ | | `CustomStateProperties` | #### Parameters | Parameter | Type | | ------ | ------ | | `input` | \{ `attemptInfo`: `object` & `CustomStateProperties`; `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.attemptInfo` | `object` & `CustomStateProperties` | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | #### Returns `Promise`\<`void`\> *** ### signOut() ```ts const signOut: (input?) => Promise = Wrapper.signOut; ``` Defined in: [recipe/passwordless/index.ts:210](https://github.com/supertokens/supertokens-auth-react/blob/b337b23722adfbe2906b193ea5fcf98f9c98c8b0/lib/ts/recipe/passwordless/index.ts#L210) #### Parameters | Parameter | Type | | ------ | ------ | | `input?` | \{ `userContext?`: [`UserContext`](types.mdx#usercontext-1); \} | | `input.userContext?` | [`UserContext`](types.mdx#usercontext-1) | #### Returns `Promise`\<`void`\> ## References ### GetRedirectionURLContext Re-exports [GetRedirectionURLContext](recipe-passwordless-types.mdx#getredirectionurlcontext) *** ### OnHandleEventContext Re-exports [OnHandleEventContext](recipe-passwordless-types.mdx#onhandleeventcontext) *** ### PreAPIHookContext Re-exports [PreAPIHookContext](recipe-passwordless-types.mdx#preapihookcontext) *** ### RecipeInterface Renames and re-exports [SuperTokensWrapper](index.mdx#supertokenswrapper-1) *** ### UserInput Re-exports [UserInput](recipe-passwordless-types.mdx#userinput)