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

## Classes

### default

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

#### Constructors

##### Constructor

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

###### Returns

[`default`](#default)

#### Methods

##### authenticateCredential()

```ts check=false reason="Generated API signature"
static authenticateCredential(input): Promise<
  | {
  authenticationResponse: AuthenticationResponseJSON;
  status: "OK";
}
  | {
  error: any;
  status: "FAILED_TO_AUTHENTICATE_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}>;
```

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

Authenticate the credential with the passed options by using native webauthn functions.

It uses `@simplewebauthn/browser` to make the webauthn calls.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `authenticationOptions`: `Omit`\<[`AuthenticationOptions`](recipe-webauthn-types#authenticationoptions), `"fetchResponse"` \| `"status"`\>; `userContext`: `any`; \} |
| `input.authenticationOptions` | `Omit`\<[`AuthenticationOptions`](recipe-webauthn-types#authenticationoptions), `"fetchResponse"` \| `"status"`\> |
| `input.userContext` | `any` |

###### Returns

`Promise`\<
  \| \{
  `authenticationResponse`: `AuthenticationResponseJSON`;
  `status`: `"OK"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_AUTHENTICATE_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along with authentication response received

##### authenticateCredentialWithSignIn()

```ts check=false reason="Generated API signature"
static authenticateCredentialWithSignIn(input): Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_IN_NOT_ALLOWED";
}
  | {
  error: any;
  status: "FAILED_TO_AUTHENTICATE_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}>;
```

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

Authenticate the user and sign them in after verifying their identity.

It uses `@simplewebauthn/browser` to make the webauthn calls.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_IN_NOT_ALLOWED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_AUTHENTICATE_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email

##### createAndRegisterCredentialForSessionUser()

```ts check=false reason="Generated API signature"
static createAndRegisterCredentialForSessionUser(input): Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
}
  | {
  reason?: string;
  status: "REGISTER_CREDENTIAL_NOT_ALLOWED";
}
  | {
  err: string;
  status: "INVALID_EMAIL_ERROR";
}
  | {
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  reason?: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}
  | {
  status: "AUTHENTICATOR_ALREADY_REGISTERED";
}
  | {
  error: any;
  status: "FAILED_TO_REGISTER_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}>;
```

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

Register the new device with the passed user details

It uses `@simplewebauthn/browser` to make the webauthn calls.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}
  \| \{
  `reason?`: `string`;
  `status`: `"REGISTER_CREDENTIAL_NOT_ALLOWED"`;
\}
  \| \{
  `err`: `string`;
  `status`: `"INVALID_EMAIL_ERROR"`;
\}
  \| \{
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `reason?`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}
  \| \{
  `status`: `"AUTHENTICATOR_ALREADY_REGISTERED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_REGISTER_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful

##### createCredential()

```ts check=false reason="Generated API signature"
static createCredential(input): Promise<
  | {
  registrationResponse: RegistrationResponseJSON;
  status: "OK";
}
  | {
  status: "AUTHENTICATOR_ALREADY_REGISTERED";
}
  | {
  error: any;
  status: "FAILED_TO_REGISTER_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}>;
```

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

Creates the credential with the passed options by using native webauthn functions.

It uses `@simplewebauthn/browser` to make the webauthn calls.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `registrationOptions`: `Omit`\<[`RegistrationOptions`](recipe-webauthn-types#registrationoptions), `"fetchResponse"` \| `"status"`\>; `userContext`: `any`; \} |
| `input.registrationOptions` | `Omit`\<[`RegistrationOptions`](recipe-webauthn-types#registrationoptions), `"fetchResponse"` \| `"status"`\> |
| `input.userContext` | `any` |

###### Returns

`Promise`\<
  \| \{
  `registrationResponse`: `RegistrationResponseJSON`;
  `status`: `"OK"`;
\}
  \| \{
  `status`: `"AUTHENTICATOR_ALREADY_REGISTERED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_REGISTER_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along with registration response received

##### doesBrowserSupportWebAuthn()

```ts check=false reason="Generated API signature"
static doesBrowserSupportWebAuthn(input): Promise<
  | {
  browserSupportsWebauthn: boolean;
  platformAuthenticatorIsAvailable: boolean;
  status: "OK";
}
  | {
  error: any;
  status: "ERROR";
}>;
```

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

###### Parameters

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

###### Returns

`Promise`\<
  \| \{
  `browserSupportsWebauthn`: `boolean`;
  `platformAuthenticatorIsAvailable`: `boolean`;
  `status`: `"OK"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"ERROR"`;
\}\>

##### generateRecoverAccountToken()

```ts check=false reason="Generated API signature"
static generateRecoverAccountToken(input): Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "RECOVER_ACCOUNT_NOT_ALLOWED";
}>;
```

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

Generate and send a recover account token.

###### 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`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"RECOVER_ACCOUNT_NOT_ALLOWED"`;
\}\>

`{ status: "OK", ...}` if successful

##### getEmailExists()

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

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

Checks whether there is an webauthn user with the passed email.

###### 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`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `exists`: `boolean`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}\>

`{ status: "OK", ...}` if successful along with a boolean indicating existence

##### getRegisterOptions()

```ts check=false reason="Generated API signature"
static getRegisterOptions(input): Promise<
  | {
  attestation: "none" | "indirect" | "direct" | "enterprise";
  authenticatorSelection: {
     requireResidentKey: boolean;
     residentKey: ResidentKey;
     userVerification: UserVerification;
  };
  challenge: string;
  createdAt: string;
  excludeCredentials: object[];
  expiresAt: string;
  fetchResponse: Response;
  pubKeyCredParams: object[];
  rp: {
     id: string;
     name: string;
  };
  status: "OK";
  timeout: number;
  user: {
     displayName: string;
     id: string;
     name: string;
  };
  webauthnGeneratedOptionsId: string;
}
  | {
  fetchResponse: Response;
  status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
}
  | {
  err: string;
  fetchResponse: Response;
  status: "INVALID_EMAIL_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}>;
```

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

Registers a new device based on the passed options and returns the
challenge to be fulfilled in order for successful addition of the identity.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | `object` & \| \{ `email`: `string`; \} \| \{ `recoverAccountToken`: `string`; \} |

###### Returns

`Promise`\<
  \| \{
  `attestation`: `"none"` \| `"indirect"` \| `"direct"` \| `"enterprise"`;
  `authenticatorSelection`: \{
     `requireResidentKey`: `boolean`;
     `residentKey`: [`ResidentKey`](recipe-webauthn-types#residentkey);
     `userVerification`: [`UserVerification`](recipe-webauthn-types#userverification);
  \};
  `challenge`: `string`;
  `createdAt`: `string`;
  `excludeCredentials`: `object`[];
  `expiresAt`: `string`;
  `fetchResponse`: `Response`;
  `pubKeyCredParams`: `object`[];
  `rp`: \{
     `id`: `string`;
     `name`: `string`;
  \};
  `status`: `"OK"`;
  `timeout`: `number`;
  `user`: \{
     `displayName`: `string`;
     `id`: `string`;
     `name`: `string`;
  \};
  `webauthnGeneratedOptionsId`: `string`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"`;
\}
  \| \{
  `err`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"INVALID_EMAIL_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the created webauthn details (challenge, etc.)

##### getSignInOptions()

```ts check=false reason="Generated API signature"
static getSignInOptions(input): Promise<
  | GeneralErrorResponse
  | {
  challenge: string;
  fetchResponse: Response;
  status: "OK";
  timeout: number;
  userVerification: UserVerification;
  webauthnGeneratedOptionsId: string;
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}>;
```

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

Returns details about how the authenticator to should verify that a signin
is correct.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `challenge`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `timeout`: `number`;
  `userVerification`: [`UserVerification`](recipe-webauthn-types#userverification);
  `webauthnGeneratedOptionsId`: `string`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the webauthn options (challenge, etc.)

##### init()

```ts check=false reason="Generated API signature"
static init(config?): CreateRecipeFunction<PreAndPostAPIHookAction>;
```

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

###### Parameters

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

###### Returns

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

##### listCredentials()

```ts check=false reason="Generated API signature"
static listCredentials(input): Promise<
  | GeneralErrorResponse
  | {
  credentials: object[];
  status: "OK";
}>;
```

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

List the credentials for the user

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `credentials`: `object`[];
  `status`: `"OK"`;
\}\>

`{ status: "OK", ...}` if successful along with a list of the user's credentials

##### recoverAccount()

```ts check=false reason="Generated API signature"
static recoverAccount(input): Promise<
  | GeneralErrorResponse
  | {
  email: string;
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}>;
```

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

Recover the account using the token received in email.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `email`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email

##### registerCredential()

```ts check=false reason="Generated API signature"
static registerCredential(input): Promise<
  | GeneralErrorResponse
  | {
  status: "OK";
}
  | {
  reason?: string;
  status: "REGISTER_CREDENTIAL_NOT_ALLOWED";
}
  | {
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  reason?: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}>;
```

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

Register the new device with the passed user details

It uses `@simplewebauthn/browser` to make the webauthn calls.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `status`: `"OK"`;
\}
  \| \{
  `reason?`: `string`;
  `status`: `"REGISTER_CREDENTIAL_NOT_ALLOWED"`;
\}
  \| \{
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `reason?`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful

##### registerCredentialWithRecoverAccount()

```ts check=false reason="Generated API signature"
static registerCredentialWithRecoverAccount(input): Promise<
  | GeneralErrorResponse
  | {
  email: string;
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_GENERATED_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}
  | {
  status: "AUTHENTICATOR_ALREADY_REGISTERED";
}
  | {
  error: any;
  status: "FAILED_TO_REGISTER_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}>;
```

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

Register the new device and recover the user's account with the recover token.

It uses `@simplewebauthn/browser` to make the webauthn calls.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `email`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_GENERATED_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}
  \| \{
  `status`: `"AUTHENTICATOR_ALREADY_REGISTERED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_REGISTER_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email

##### registerCredentialWithSignUp()

```ts check=false reason="Generated API signature"
static registerCredentialWithSignUp(input): Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  err: string;
  fetchResponse: Response;
  status: "INVALID_EMAIL_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_GENERATED_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_UP_NOT_ALLOWED";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}
  | {
  fetchResponse: Response;
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}
  | {
  status: "AUTHENTICATOR_ALREADY_REGISTERED";
}
  | {
  error: any;
  status: "FAILED_TO_REGISTER_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}>;
```

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

Register the new device and signup the user with the passed email ID.

It uses `@simplewebauthn/browser` to make the webauthn calls.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `err`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"INVALID_EMAIL_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_GENERATED_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_UP_NOT_ALLOWED"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"EMAIL_ALREADY_EXISTS_ERROR"`;
\}
  \| \{
  `status`: `"AUTHENTICATOR_ALREADY_REGISTERED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_REGISTER_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email

##### removeCredential()

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

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

Remove the credential for the passed credential ID

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `status`: `"OK"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"CREDENTIAL_NOT_FOUND_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful

##### signIn()

```ts check=false reason="Generated API signature"
static signIn(input): Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_IN_NOT_ALLOWED";
}>;
```

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

Sign in with the credential and the generated options ID.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_IN_NOT_ALLOWED"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.)

##### signUp()

```ts check=false reason="Generated API signature"
static signUp(input): Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_UP_NOT_ALLOWED";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}
  | {
  fetchResponse: Response;
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}>;
```

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

Signup to ST with the webauthn options ID and the credential received from the
device.

###### Parameters

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

###### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_UP_NOT_ALLOWED"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"EMAIL_ALREADY_EXISTS_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.)

## Variables

### authenticateCredential()

```ts check=false reason="Generated API signature"
const authenticateCredential: (input) => Promise<
  | {
  authenticationResponse: AuthenticationResponseJSON;
  status: "OK";
}
  | {
  error: any;
  status: "FAILED_TO_AUTHENTICATE_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}> = RecipeWrapper.authenticateCredential;
```

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

Authenticate the credential with the passed options by using native webauthn functions.

It uses `@simplewebauthn/browser` to make the webauthn calls.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `authenticationOptions`: `Omit`\<[`AuthenticationOptions`](recipe-webauthn-types#authenticationoptions), `"fetchResponse"` \| `"status"`\>; `userContext`: `any`; \} |
| `input.authenticationOptions` | `Omit`\<[`AuthenticationOptions`](recipe-webauthn-types#authenticationoptions), `"fetchResponse"` \| `"status"`\> |
| `input.userContext` | `any` |

#### Returns

`Promise`\<
  \| \{
  `authenticationResponse`: `AuthenticationResponseJSON`;
  `status`: `"OK"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_AUTHENTICATE_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along with authentication response received

***

### authenticateCredentialWithSignIn()

```ts check=false reason="Generated API signature"
const authenticateCredentialWithSignIn: (input) => Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_IN_NOT_ALLOWED";
}
  | {
  error: any;
  status: "FAILED_TO_AUTHENTICATE_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}> = RecipeWrapper.authenticateCredentialWithSignIn;
```

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

Authenticate the user and sign them in after verifying their identity.

It uses `@simplewebauthn/browser` to make the webauthn calls.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_IN_NOT_ALLOWED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_AUTHENTICATE_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email

***

### createAndRegisterCredentialForSessionUser()

```ts check=false reason="Generated API signature"
const createAndRegisterCredentialForSessionUser: (input) => Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
}
  | {
  reason?: string;
  status: "REGISTER_CREDENTIAL_NOT_ALLOWED";
}
  | {
  err: string;
  status: "INVALID_EMAIL_ERROR";
}
  | {
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  reason?: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}
  | {
  status: "AUTHENTICATOR_ALREADY_REGISTERED";
}
  | {
  error: any;
  status: "FAILED_TO_REGISTER_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}> = RecipeWrapper.createAndRegisterCredentialForSessionUser;
```

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

Register the new device with the passed user details

It uses `@simplewebauthn/browser` to make the webauthn calls.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}
  \| \{
  `reason?`: `string`;
  `status`: `"REGISTER_CREDENTIAL_NOT_ALLOWED"`;
\}
  \| \{
  `err`: `string`;
  `status`: `"INVALID_EMAIL_ERROR"`;
\}
  \| \{
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `reason?`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}
  \| \{
  `status`: `"AUTHENTICATOR_ALREADY_REGISTERED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_REGISTER_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful

***

### createCredential()

```ts check=false reason="Generated API signature"
const createCredential: (input) => Promise<
  | {
  registrationResponse: RegistrationResponseJSON;
  status: "OK";
}
  | {
  status: "AUTHENTICATOR_ALREADY_REGISTERED";
}
  | {
  error: any;
  status: "FAILED_TO_REGISTER_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}> = RecipeWrapper.createCredential;
```

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

Creates the credential with the passed options by using native webauthn functions.

It uses `@simplewebauthn/browser` to make the webauthn calls.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `registrationOptions`: `Omit`\<[`RegistrationOptions`](recipe-webauthn-types#registrationoptions), `"fetchResponse"` \| `"status"`\>; `userContext`: `any`; \} |
| `input.registrationOptions` | `Omit`\<[`RegistrationOptions`](recipe-webauthn-types#registrationoptions), `"fetchResponse"` \| `"status"`\> |
| `input.userContext` | `any` |

#### Returns

`Promise`\<
  \| \{
  `registrationResponse`: `RegistrationResponseJSON`;
  `status`: `"OK"`;
\}
  \| \{
  `status`: `"AUTHENTICATOR_ALREADY_REGISTERED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_REGISTER_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along with registration response received

***

### doesBrowserSupportWebAuthn()

```ts check=false reason="Generated API signature"
const doesBrowserSupportWebAuthn: (input) => Promise<
  | {
  browserSupportsWebauthn: boolean;
  platformAuthenticatorIsAvailable: boolean;
  status: "OK";
}
  | {
  error: any;
  status: "ERROR";
}> = RecipeWrapper.doesBrowserSupportWebAuthn;
```

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

#### Parameters

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

#### Returns

`Promise`\<
  \| \{
  `browserSupportsWebauthn`: `boolean`;
  `platformAuthenticatorIsAvailable`: `boolean`;
  `status`: `"OK"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"ERROR"`;
\}\>

***

### generateRecoverAccountToken()

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

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

Generate and send a recover account token.

#### 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`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"RECOVER_ACCOUNT_NOT_ALLOWED"`;
\}\>

`{ status: "OK", ...}` if successful

***

### getEmailExists()

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

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

Checks whether there is an webauthn user with the passed email.

#### 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`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `exists`: `boolean`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
\}\>

`{ status: "OK", ...}` if successful along with a boolean indicating existence

***

### getRegisterOptions()

```ts check=false reason="Generated API signature"
const getRegisterOptions: (input) => Promise<
  | {
  attestation: "none" | "indirect" | "direct" | "enterprise";
  authenticatorSelection: {
     requireResidentKey: boolean;
     residentKey: ResidentKey;
     userVerification: UserVerification;
  };
  challenge: string;
  createdAt: string;
  excludeCredentials: object[];
  expiresAt: string;
  fetchResponse: Response;
  pubKeyCredParams: object[];
  rp: {
     id: string;
     name: string;
  };
  status: "OK";
  timeout: number;
  user: {
     displayName: string;
     id: string;
     name: string;
  };
  webauthnGeneratedOptionsId: string;
}
  | {
  fetchResponse: Response;
  status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
}
  | {
  err: string;
  fetchResponse: Response;
  status: "INVALID_EMAIL_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}> = RecipeWrapper.getRegisterOptions;
```

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

Registers a new device based on the passed options and returns the
challenge to be fulfilled in order for successful addition of the identity.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | `object` & \| \{ `email`: `string`; \} \| \{ `recoverAccountToken`: `string`; \} |

#### Returns

`Promise`\<
  \| \{
  `attestation`: `"none"` \| `"indirect"` \| `"direct"` \| `"enterprise"`;
  `authenticatorSelection`: \{
     `requireResidentKey`: `boolean`;
     `residentKey`: [`ResidentKey`](recipe-webauthn-types#residentkey);
     `userVerification`: [`UserVerification`](recipe-webauthn-types#userverification);
  \};
  `challenge`: `string`;
  `createdAt`: `string`;
  `excludeCredentials`: `object`[];
  `expiresAt`: `string`;
  `fetchResponse`: `Response`;
  `pubKeyCredParams`: `object`[];
  `rp`: \{
     `id`: `string`;
     `name`: `string`;
  \};
  `status`: `"OK"`;
  `timeout`: `number`;
  `user`: \{
     `displayName`: `string`;
     `id`: `string`;
     `name`: `string`;
  \};
  `webauthnGeneratedOptionsId`: `string`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"`;
\}
  \| \{
  `err`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"INVALID_EMAIL_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the created webauthn details (challenge, etc.)

***

### getSignInOptions()

```ts check=false reason="Generated API signature"
const getSignInOptions: (input) => Promise<
  | GeneralErrorResponse
  | {
  challenge: string;
  fetchResponse: Response;
  status: "OK";
  timeout: number;
  userVerification: UserVerification;
  webauthnGeneratedOptionsId: string;
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}> = RecipeWrapper.getSignInOptions;
```

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

Returns details about how the authenticator to should verify that a signin
is correct.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `challenge`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `timeout`: `number`;
  `userVerification`: [`UserVerification`](recipe-webauthn-types#userverification);
  `webauthnGeneratedOptionsId`: `string`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the webauthn options (challenge, etc.)

***

### init()

```ts check=false reason="Generated API signature"
const init: (config?) => CreateRecipeFunction<PreAndPostAPIHookAction> = RecipeWrapper.init;
```

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

#### Parameters

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

#### Returns

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

***

### listCredentials()

```ts check=false reason="Generated API signature"
const listCredentials: (input) => Promise<
  | GeneralErrorResponse
  | {
  credentials: object[];
  status: "OK";
}> = RecipeWrapper.listCredentials;
```

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

List the credentials for the user

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `credentials`: `object`[];
  `status`: `"OK"`;
\}\>

`{ status: "OK", ...}` if successful along with a list of the user's credentials

***

### recoverAccount()

```ts check=false reason="Generated API signature"
const recoverAccount: (input) => Promise<
  | GeneralErrorResponse
  | {
  email: string;
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}> = RecipeWrapper.recoverAccount;
```

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

Recover the account using the token received in email.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `email`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email

***

### registerCredential()

```ts check=false reason="Generated API signature"
const registerCredential: (input) => Promise<
  | GeneralErrorResponse
  | {
  status: "OK";
}
  | {
  reason?: string;
  status: "REGISTER_CREDENTIAL_NOT_ALLOWED";
}
  | {
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  reason?: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}> = RecipeWrapper.registerCredential;
```

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

Register the new device with the passed user details

It uses `@simplewebauthn/browser` to make the webauthn calls.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `status`: `"OK"`;
\}
  \| \{
  `reason?`: `string`;
  `status`: `"REGISTER_CREDENTIAL_NOT_ALLOWED"`;
\}
  \| \{
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `reason?`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful

***

### registerCredentialWithRecoverAccount()

```ts check=false reason="Generated API signature"
const registerCredentialWithRecoverAccount: (input) => Promise<
  | GeneralErrorResponse
  | {
  email: string;
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_GENERATED_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}
  | {
  status: "AUTHENTICATOR_ALREADY_REGISTERED";
}
  | {
  error: any;
  status: "FAILED_TO_REGISTER_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}> = RecipeWrapper.registerCredentialWithRecoverAccount;
```

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

Register the new device and recover the user's account with the recover token.

It uses `@simplewebauthn/browser` to make the webauthn calls.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `email`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_GENERATED_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}
  \| \{
  `status`: `"AUTHENTICATOR_ALREADY_REGISTERED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_REGISTER_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email

***

### registerCredentialWithSignUp()

```ts check=false reason="Generated API signature"
const registerCredentialWithSignUp: (input) => Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  err: string;
  fetchResponse: Response;
  status: "INVALID_EMAIL_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_GENERATED_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_UP_NOT_ALLOWED";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}
  | {
  fetchResponse: Response;
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}
  | {
  status: "AUTHENTICATOR_ALREADY_REGISTERED";
}
  | {
  error: any;
  status: "FAILED_TO_REGISTER_USER";
}
  | {
  error: any;
  status: "WEBAUTHN_NOT_SUPPORTED";
}> = RecipeWrapper.registerCredentialWithSignUp;
```

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

Register the new device and signup the user with the passed email ID.

It uses `@simplewebauthn/browser` to make the webauthn calls.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `err`: `string`;
  `fetchResponse`: `Response`;
  `status`: `"INVALID_EMAIL_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_GENERATED_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_UP_NOT_ALLOWED"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"EMAIL_ALREADY_EXISTS_ERROR"`;
\}
  \| \{
  `status`: `"AUTHENTICATOR_ALREADY_REGISTERED"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"FAILED_TO_REGISTER_USER"`;
\}
  \| \{
  `error`: `any`;
  `status`: `"WEBAUTHN_NOT_SUPPORTED"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.) and email

***

### removeCredential()

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

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

Remove the credential for the passed credential ID

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `status`: `"OK"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"CREDENTIAL_NOT_FOUND_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful

***

### signIn()

```ts check=false reason="Generated API signature"
const signIn: (input) => Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_IN_NOT_ALLOWED";
}> = RecipeWrapper.signIn;
```

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

Sign in with the credential and the generated options ID.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_IN_NOT_ALLOWED"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.)

***

### signUp()

```ts check=false reason="Generated API signature"
const signUp: (input) => Promise<
  | GeneralErrorResponse
  | {
  fetchResponse: Response;
  status: "OK";
  user: User;
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "SIGN_UP_NOT_ALLOWED";
}
  | {
  fetchResponse: Response;
  status: "INVALID_CREDENTIALS_ERROR";
}
  | {
  fetchResponse: Response;
  status: "OPTIONS_NOT_FOUND_ERROR";
}
  | {
  fetchResponse: Response;
  status: "INVALID_OPTIONS_ERROR";
}
  | {
  fetchResponse: Response;
  reason: string;
  status: "INVALID_AUTHENTICATOR_ERROR";
}
  | {
  fetchResponse: Response;
  status: "EMAIL_ALREADY_EXISTS_ERROR";
}> = RecipeWrapper.signUp;
```

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

Signup to ST with the webauthn options ID and the credential received from the
device.

#### Parameters

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

#### Returns

`Promise`\<
  \| [`GeneralErrorResponse`](types#generalerrorresponse)
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OK"`;
  `user`: [`User`](types#user);
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"SIGN_UP_NOT_ALLOWED"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_CREDENTIALS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"OPTIONS_NOT_FOUND_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"INVALID_OPTIONS_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `reason`: `string`;
  `status`: `"INVALID_AUTHENTICATOR_ERROR"`;
\}
  \| \{
  `fetchResponse`: `Response`;
  `status`: `"EMAIL_ALREADY_EXISTS_ERROR"`;
\}\>

`{ status: "OK", ...}` if successful along a description of the user details (id, etc.)

## References

### RecipeInterface

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