Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

supertokens-node/recipe/webauthn

References documentation for the supertokens-node/recipe/webauthn package

Classes

default

Defined in: recipe/webauthn/index.ts

Constructors

Constructor
new default(): default;
Returns

default

Properties

Property Modifier Type Default value Defined in
Error static typeof default SuperTokensError recipe/webauthn/index.ts
init static (config?) => RecipeListFunction Recipe.init recipe/webauthn/index.ts

Methods

consumeRecoverAccountToken()
static consumeRecoverAccountToken(input): Promise<
  | {
  email: string;
  status: "OK";
  userId: string;
}
| ConsumeRecoverAccountTokenErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { tenantId: string; token: string; userContext?: Record<string, any>; }
input.tenantId string
input.token string
input.userContext? Record<string, any>
Returns

Promise< | { email: string; status: "OK"; userId: string; } | ConsumeRecoverAccountTokenErrorResponse>

static createRecoverAccountLink(__namedParameters): Promise<
  | GenerateRecoverAccountTokenErrorResponse
  | {
  link: string;
  status: string;
}>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
__namedParameters { email: string; tenantId: string; userContext?: Record<string, any>; userId: string; }
__namedParameters.email string
__namedParameters.tenantId string
__namedParameters.userContext? Record<string, any>
__namedParameters.userId string
Returns

Promise< | GenerateRecoverAccountTokenErrorResponse | { link: string; status: string; }>

generateRecoverAccountToken()
static generateRecoverAccountToken(input): Promise<
  | {
  status: "OK";
  token: string;
}
| GenerateRecoverAccountTokenErrorResponse>;

Defined in: recipe/webauthn/index.ts

We do not make email optional here because we want to allow passing in primaryUserId. If we make email optional, and if the user provides a primaryUserId, then it may result in two problems:

  • there is no recipeUserId = input primaryUserId, in this case, this function will throw an error
  • There is a recipe userId = input primaryUserId, but that recipe has no email, or has wrong email compared to what the user wanted to generate a reset token for.

And we want to allow primaryUserId being passed in.

Parameters
Parameter Type
input { email: string; tenantId: string; userContext?: Record<string, any>; userId: string; }
input.email string
input.tenantId string
input.userContext? Record<string, any>
input.userId string
Returns

Promise< | { status: "OK"; token: string; } | GenerateRecoverAccountTokenErrorResponse>

getCredential()
static getCredential(input): Promise<
  | {
  createdAt: number;
  recipeUserId: RecipeUserId;
  relyingPartyId: string;
  status: "OK";
  webauthnCredentialId: string;
}
| GetCredentialErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { recipeUserId: string; userContext?: Record<string, any>; webauthnCredentialId: string; }
input.recipeUserId string
input.userContext? Record<string, any>
input.webauthnCredentialId string
Returns

Promise< | { createdAt: number; recipeUserId: RecipeUserId; relyingPartyId: string; status: "OK"; webauthnCredentialId: string; } | GetCredentialErrorResponse>

getGeneratedOptions()
static getGeneratedOptions(input): Promise<
  | {
  challenge: string;
  createdAt: number;
  email?: string;
  expiresAt: number;
  origin: string;
  relyingPartyId: string;
  relyingPartyName: string;
  status: "OK";
  timeout: number;
  userPresence: boolean;
  userVerification: UserVerification;
  webauthnGeneratedOptionsId: string;
}
| GetGeneratedOptionsErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string
Returns

Promise< | { challenge: string; createdAt: number; email?: string; expiresAt: number; origin: string; relyingPartyId: string; relyingPartyName: string; status: "OK"; timeout: number; userPresence: boolean; userVerification: UserVerification; webauthnGeneratedOptionsId: string; } | GetGeneratedOptionsErrorResponse>

getUserFromRecoverAccountToken()
static getUserFromRecoverAccountToken(input): Promise<
  | {
  recipeUserId?: RecipeUserId;
  status: "OK";
  user: User;
}
| GetUserFromRecoverAccountTokenErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { tenantId: string; token: string; userContext?: Record<string, any>; }
input.tenantId string
input.token string
input.userContext? Record<string, any>
Returns

Promise< | { recipeUserId?: RecipeUserId; status: "OK"; user: User; } | GetUserFromRecoverAccountTokenErrorResponse>

listCredentials()
static listCredentials(input): Promise<{
  credentials: object[];
  status: "OK";
}>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { recipeUserId: string; userContext?: Record<string, any>; }
input.recipeUserId string
input.userContext? Record<string, any>
Returns

Promise<{ credentials: object[]; status: "OK"; }>

recoverAccount()
static recoverAccount(__namedParameters): Promise<
  | ConsumeRecoverAccountTokenErrorResponse
  | {
  status: "OK";
}
| RegisterCredentialErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
__namedParameters { credential: RegistrationPayload; tenantId?: string; token: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
__namedParameters.credential RegistrationPayload
__namedParameters.tenantId? string
__namedParameters.token string
__namedParameters.userContext? Record<string, any>
__namedParameters.webauthnGeneratedOptionsId string
Returns

Promise< | ConsumeRecoverAccountTokenErrorResponse | { status: "OK"; } | RegisterCredentialErrorResponse>

registerCredential()
static registerCredential(input): Promise<
  | {
  status: "OK";
}
| RegisterCredentialErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { credential: RegistrationPayload; recipeUserId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.credential RegistrationPayload
input.recipeUserId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string
Returns

Promise< | { status: "OK"; } | RegisterCredentialErrorResponse>

registerOptions()
static registerOptions(input): Promise<
  | {
  attestation: Attestation;
  authenticatorSelection: {
     requireResidentKey: boolean;
     residentKey: ResidentKey;
     userVerification: UserVerification;
  };
  challenge: string;
  createdAt: number;
  excludeCredentials: object[];
  expiresAt: number;
  pubKeyCredParams: object[];
  rp: {
     id: string;
     name: string;
  };
  status: "OK";
  timeout: number;
  user: {
     displayName: string;
     id: string;
     name: string;
  };
  webauthnGeneratedOptionsId: string;
}
| RegisterOptionsErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input object & | { recoverAccountToken: string; } | { displayName: string; email: string; }
Returns

Promise< | { attestation: Attestation; authenticatorSelection: { requireResidentKey: boolean; residentKey: ResidentKey; userVerification: UserVerification; }; challenge: string; createdAt: number; excludeCredentials: object[]; expiresAt: number; pubKeyCredParams: object[]; rp: { id: string; name: string; }; status: "OK"; timeout: number; user: { displayName: string; id: string; name: string; }; webauthnGeneratedOptionsId: string; } | RegisterOptionsErrorResponse>

removeCredential()
static removeCredential(input): Promise<
  | {
  status: "OK";
}
| RemoveCredentialErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { recipeUserId: string; userContext?: Record<string, any>; webauthnCredentialId: string; }
input.recipeUserId string
input.userContext? Record<string, any>
input.webauthnCredentialId string
Returns

Promise< | { status: "OK"; } | RemoveCredentialErrorResponse>

removeGeneratedOptions()
static removeGeneratedOptions(input): Promise<
  | {
  status: "OK";
}
| RemoveGeneratedOptionsErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string
Returns

Promise< | { status: "OK"; } | RemoveGeneratedOptionsErrorResponse>

sendEmail()
static sendEmail(input): Promise<void>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input TypeWebauthnRecoverAccountEmailDeliveryInput & object
Returns

Promise<void>

sendRecoverAccountEmail()
static sendRecoverAccountEmail(__namedParameters): Promise<
  | {
  link: string;
  status: string;
}
  | {
  status: string;
}>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
__namedParameters { email: string; tenantId: string; userContext?: Record<string, any>; userId: string; }
__namedParameters.email string
__namedParameters.tenantId string
__namedParameters.userContext? Record<string, any>
__namedParameters.userId string
Returns

Promise< | { link: string; status: string; } | { status: string; }>

signIn()
static signIn(input): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
| SignInErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { credential: AuthenticationPayload; session: SessionContainerInterface; shouldTryLinkingWithSessionUser: boolean; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.credential AuthenticationPayload
input.session SessionContainerInterface
input.shouldTryLinkingWithSessionUser boolean
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string
Returns

Promise< | { recipeUserId: RecipeUserId; status: "OK"; user: User; } | SignInErrorResponse>

signInOptions()
static signInOptions(input): Promise<
  | {
  challenge: string;
  createdAt: number;
  expiresAt: number;
  status: "OK";
  timeout: number;
  userVerification: UserVerification;
  webauthnGeneratedOptionsId: string;
}
| SignInOptionsErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { origin: string; relyingPartyId: string; relyingPartyName: string; tenantId: string; timeout: number; userContext?: Record<string, any>; userPresence: boolean; userVerification: UserVerification; }
input.origin string
input.relyingPartyId string
input.relyingPartyName string
input.tenantId string
input.timeout number
input.userContext? Record<string, any>
input.userPresence boolean
input.userVerification UserVerification
Returns

Promise< | { challenge: string; createdAt: number; expiresAt: number; status: "OK"; timeout: number; userVerification: UserVerification; webauthnGeneratedOptionsId: string; } | SignInOptionsErrorResponse>

signUp()
static signUp(input): Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
| SignUpErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { credential: RegistrationPayload; session: SessionContainerInterface; shouldTryLinkingWithSessionUser: boolean; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.credential RegistrationPayload
input.session SessionContainerInterface
input.shouldTryLinkingWithSessionUser boolean
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string
Returns

Promise< | { recipeUserId: RecipeUserId; status: "OK"; user: User; } | SignUpErrorResponse>

updateUserEmail()
static updateUserEmail(input): Promise<
  | {
  status: "OK";
}
| UpdateUserEmailErrorResponse>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { email: string; recipeUserId: string; tenantId: string; userContext?: Record<string, any>; }
input.email string
input.recipeUserId string
input.tenantId string
input.userContext? Record<string, any>
Returns

Promise< | { status: "OK"; } | UpdateUserEmailErrorResponse>

verifyCredentials()
static verifyCredentials(input): Promise<{
  status:   | "OK"
     | "UNKNOWN_USER_ID_ERROR"
     | "INVALID_CREDENTIALS_ERROR"
     | "INVALID_OPTIONS_ERROR"
     | "INVALID_AUTHENTICATOR_ERROR"
     | "CREDENTIAL_NOT_FOUND_ERROR"
     | "OPTIONS_NOT_FOUND_ERROR";
}>;

Defined in: recipe/webauthn/index.ts

Parameters
Parameter Type
input { credential: AuthenticationPayload; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.credential AuthenticationPayload
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string
Returns

Promise<{ status: | "OK" | "UNKNOWN_USER_ID_ERROR" | "INVALID_CREDENTIALS_ERROR" | "INVALID_OPTIONS_ERROR" | "INVALID_AUTHENTICATOR_ERROR" | "CREDENTIAL_NOT_FOUND_ERROR" | "OPTIONS_NOT_FOUND_ERROR"; }>

Variables

consumeRecoverAccountToken()

consumeRecoverAccountToken: (input) => Promise<
  | {
  email: string;
  status: "OK";
  userId: string;
}
  | ConsumeRecoverAccountTokenErrorResponse> = Wrapper.consumeRecoverAccountToken;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { tenantId: string; token: string; userContext?: Record<string, any>; }
input.tenantId string
input.token string
input.userContext? Record<string, any>

Returns

Promise< | { email: string; status: "OK"; userId: string; } | ConsumeRecoverAccountTokenErrorResponse>


createRecoverAccountLink: (__namedParameters) => Promise<
  | GenerateRecoverAccountTokenErrorResponse
  | {
  link: string;
  status: string;
}> = Wrapper.createRecoverAccountLink;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
__namedParameters { email: string; tenantId: string; userContext?: Record<string, any>; userId: string; }
__namedParameters.email string
__namedParameters.tenantId string
__namedParameters.userContext? Record<string, any>
__namedParameters.userId string

Returns

Promise< | GenerateRecoverAccountTokenErrorResponse | { link: string; status: string; }>


Error

Error: typeof default = Wrapper.Error;

Defined in: recipe/webauthn/index.ts


generateRecoverAccountToken()

generateRecoverAccountToken: (input) => Promise<
  | {
  status: "OK";
  token: string;
}
  | GenerateRecoverAccountTokenErrorResponse> = Wrapper.generateRecoverAccountToken;

Defined in: recipe/webauthn/index.ts

We do not make email optional here because we want to allow passing in primaryUserId. If we make email optional, and if the user provides a primaryUserId, then it may result in two problems:

  • there is no recipeUserId = input primaryUserId, in this case, this function will throw an error
  • There is a recipe userId = input primaryUserId, but that recipe has no email, or has wrong email compared to what the user wanted to generate a reset token for.

And we want to allow primaryUserId being passed in.

Parameters

Parameter Type
input { email: string; tenantId: string; userContext?: Record<string, any>; userId: string; }
input.email string
input.tenantId string
input.userContext? Record<string, any>
input.userId string

Returns

Promise< | { status: "OK"; token: string; } | GenerateRecoverAccountTokenErrorResponse>


getCredential()

getCredential: (input) => Promise<
  | {
  createdAt: number;
  recipeUserId: RecipeUserId;
  relyingPartyId: string;
  status: "OK";
  webauthnCredentialId: string;
}
  | GetCredentialErrorResponse> = Wrapper.getCredential;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { recipeUserId: string; userContext?: Record<string, any>; webauthnCredentialId: string; }
input.recipeUserId string
input.userContext? Record<string, any>
input.webauthnCredentialId string

Returns

Promise< | { createdAt: number; recipeUserId: RecipeUserId; relyingPartyId: string; status: "OK"; webauthnCredentialId: string; } | GetCredentialErrorResponse>


getGeneratedOptions()

getGeneratedOptions: (input) => Promise<
  | {
  challenge: string;
  createdAt: number;
  email?: string;
  expiresAt: number;
  origin: string;
  relyingPartyId: string;
  relyingPartyName: string;
  status: "OK";
  timeout: number;
  userPresence: boolean;
  userVerification: UserVerification;
  webauthnGeneratedOptionsId: string;
}
  | GetGeneratedOptionsErrorResponse> = Wrapper.getGeneratedOptions;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string

Returns

Promise< | { challenge: string; createdAt: number; email?: string; expiresAt: number; origin: string; relyingPartyId: string; relyingPartyName: string; status: "OK"; timeout: number; userPresence: boolean; userVerification: UserVerification; webauthnGeneratedOptionsId: string; } | GetGeneratedOptionsErrorResponse>


getUserFromRecoverAccountToken()

getUserFromRecoverAccountToken: (input) => Promise<
  | {
  recipeUserId?: RecipeUserId;
  status: "OK";
  user: User;
}
  | GetUserFromRecoverAccountTokenErrorResponse> = Wrapper.getUserFromRecoverAccountToken;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { tenantId: string; token: string; userContext?: Record<string, any>; }
input.tenantId string
input.token string
input.userContext? Record<string, any>

Returns

Promise< | { recipeUserId?: RecipeUserId; status: "OK"; user: User; } | GetUserFromRecoverAccountTokenErrorResponse>


init()

init: (config?) => RecipeListFunction = Wrapper.init;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
config? TypeInput

Returns

RecipeListFunction


listCredentials()

listCredentials: (input) => Promise<{
  credentials: object[];
  status: "OK";
}> = Wrapper.listCredentials;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { recipeUserId: string; userContext?: Record<string, any>; }
input.recipeUserId string
input.userContext? Record<string, any>

Returns

Promise<{ credentials: object[]; status: "OK"; }>


recoverAccount()

recoverAccount: (__namedParameters) => Promise<
  | ConsumeRecoverAccountTokenErrorResponse
  | {
  status: "OK";
}
  | RegisterCredentialErrorResponse> = Wrapper.recoverAccount;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
__namedParameters { credential: RegistrationPayload; tenantId?: string; token: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
__namedParameters.credential RegistrationPayload
__namedParameters.tenantId? string
__namedParameters.token string
__namedParameters.userContext? Record<string, any>
__namedParameters.webauthnGeneratedOptionsId string

Returns

Promise< | ConsumeRecoverAccountTokenErrorResponse | { status: "OK"; } | RegisterCredentialErrorResponse>


registerCredential()

registerCredential: (input) => Promise<
  | {
  status: "OK";
}
  | RegisterCredentialErrorResponse> = Wrapper.registerCredential;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { credential: RegistrationPayload; recipeUserId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.credential RegistrationPayload
input.recipeUserId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string

Returns

Promise< | { status: "OK"; } | RegisterCredentialErrorResponse>


registerOptions()

registerOptions: (input) => Promise<
  | {
  attestation: Attestation;
  authenticatorSelection: {
     requireResidentKey: boolean;
     residentKey: ResidentKey;
     userVerification: UserVerification;
  };
  challenge: string;
  createdAt: number;
  excludeCredentials: object[];
  expiresAt: number;
  pubKeyCredParams: object[];
  rp: {
     id: string;
     name: string;
  };
  status: "OK";
  timeout: number;
  user: {
     displayName: string;
     id: string;
     name: string;
  };
  webauthnGeneratedOptionsId: string;
}
  | RegisterOptionsErrorResponse> = Wrapper.registerOptions;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input object & | { recoverAccountToken: string; } | { displayName: string; email: string; }

Returns

Promise< | { attestation: Attestation; authenticatorSelection: { requireResidentKey: boolean; residentKey: ResidentKey; userVerification: UserVerification; }; challenge: string; createdAt: number; excludeCredentials: object[]; expiresAt: number; pubKeyCredParams: object[]; rp: { id: string; name: string; }; status: "OK"; timeout: number; user: { displayName: string; id: string; name: string; }; webauthnGeneratedOptionsId: string; } | RegisterOptionsErrorResponse>


removeCredential()

removeCredential: (input) => Promise<
  | {
  status: "OK";
}
  | RemoveCredentialErrorResponse> = Wrapper.removeCredential;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { recipeUserId: string; userContext?: Record<string, any>; webauthnCredentialId: string; }
input.recipeUserId string
input.userContext? Record<string, any>
input.webauthnCredentialId string

Returns

Promise< | { status: "OK"; } | RemoveCredentialErrorResponse>


removeGeneratedOptions()

removeGeneratedOptions: (input) => Promise<
  | {
  status: "OK";
}
  | RemoveGeneratedOptionsErrorResponse> = Wrapper.removeGeneratedOptions;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string

Returns

Promise< | { status: "OK"; } | RemoveGeneratedOptionsErrorResponse>


sendEmail()

sendEmail: (input) => Promise<void> = Wrapper.sendEmail;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input TypeWebauthnRecoverAccountEmailDeliveryInput & object

Returns

Promise<void>


sendRecoverAccountEmail()

sendRecoverAccountEmail: (__namedParameters) => Promise<
  | {
  link: string;
  status: string;
}
  | {
  status: string;
}> = Wrapper.sendRecoverAccountEmail;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
__namedParameters { email: string; tenantId: string; userContext?: Record<string, any>; userId: string; }
__namedParameters.email string
__namedParameters.tenantId string
__namedParameters.userContext? Record<string, any>
__namedParameters.userId string

Returns

Promise< | { link: string; status: string; } | { status: string; }>


signIn()

signIn: (input) => Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | SignInErrorResponse> = Wrapper.signIn;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { credential: AuthenticationPayload; session: SessionContainerInterface; shouldTryLinkingWithSessionUser: boolean; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.credential AuthenticationPayload
input.session SessionContainerInterface
input.shouldTryLinkingWithSessionUser boolean
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string

Returns

Promise< | { recipeUserId: RecipeUserId; status: "OK"; user: User; } | SignInErrorResponse>


signInOptions()

signInOptions: (input) => Promise<
  | {
  challenge: string;
  createdAt: number;
  expiresAt: number;
  status: "OK";
  timeout: number;
  userVerification: UserVerification;
  webauthnGeneratedOptionsId: string;
}
  | SignInOptionsErrorResponse> = Wrapper.signInOptions;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { origin: string; relyingPartyId: string; relyingPartyName: string; tenantId: string; timeout: number; userContext?: Record<string, any>; userPresence: boolean; userVerification: UserVerification; }
input.origin string
input.relyingPartyId string
input.relyingPartyName string
input.tenantId string
input.timeout number
input.userContext? Record<string, any>
input.userPresence boolean
input.userVerification UserVerification

Returns

Promise< | { challenge: string; createdAt: number; expiresAt: number; status: "OK"; timeout: number; userVerification: UserVerification; webauthnGeneratedOptionsId: string; } | SignInOptionsErrorResponse>


signUp()

signUp: (input) => Promise<
  | {
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | SignUpErrorResponse> = Wrapper.signUp;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { credential: RegistrationPayload; session: SessionContainerInterface; shouldTryLinkingWithSessionUser: boolean; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.credential RegistrationPayload
input.session SessionContainerInterface
input.shouldTryLinkingWithSessionUser boolean
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string

Returns

Promise< | { recipeUserId: RecipeUserId; status: "OK"; user: User; } | SignUpErrorResponse>


updateUserEmail()

updateUserEmail: (input) => Promise<
  | {
  status: "OK";
}
  | UpdateUserEmailErrorResponse> = Wrapper.updateUserEmail;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { email: string; recipeUserId: string; tenantId: string; userContext?: Record<string, any>; }
input.email string
input.recipeUserId string
input.tenantId string
input.userContext? Record<string, any>

Returns

Promise< | { status: "OK"; } | UpdateUserEmailErrorResponse>


verifyCredentials()

verifyCredentials: (input) => Promise<{
  status:   | "OK"
     | "UNKNOWN_USER_ID_ERROR"
     | "INVALID_CREDENTIALS_ERROR"
     | "INVALID_OPTIONS_ERROR"
     | "INVALID_AUTHENTICATOR_ERROR"
     | "CREDENTIAL_NOT_FOUND_ERROR"
     | "OPTIONS_NOT_FOUND_ERROR";
}> = Wrapper.verifyCredentials;

Defined in: recipe/webauthn/index.ts

Parameters

Parameter Type
input { credential: AuthenticationPayload; tenantId: string; userContext?: Record<string, any>; webauthnGeneratedOptionsId: string; }
input.credential AuthenticationPayload
input.tenantId string
input.userContext? Record<string, any>
input.webauthnGeneratedOptionsId string

Returns

Promise<{ status: | "OK" | "UNKNOWN_USER_ID_ERROR" | "INVALID_CREDENTIALS_ERROR" | "INVALID_OPTIONS_ERROR" | "INVALID_AUTHENTICATOR_ERROR" | "CREDENTIAL_NOT_FOUND_ERROR" | "OPTIONS_NOT_FOUND_ERROR"; }>

References

APIInterface

Re-exports APIInterface


APIOptions

Re-exports APIOptions


RecipeInterface

Re-exports RecipeInterface

API reference

API schema and response details