Skip to main content

Overview

The webauthn sub-client manages FIDO2/WebAuthn passkey credentials for your end-users. You can generate registration options, verify registration responses, list credentials, and delete them.

webauthn.registerOptions()

Generate WebAuthn registration options for a principal. Returns a PublicKeyCredentialCreationOptions-compatible object that you pass to navigator.credentials.create() in the browser.

Parameters

string
required
The ID of the principal (end-user) to register a passkey for.

Response: WebAuthnRegisterOptions

string
Base64url-encoded challenge for the registration ceremony.
object
Relying party information (name, id).
object
User entity (id, name, displayName) for the credential.
object[]
Supported public key algorithms (e.g., ES256, RS256).
number
Timeout in milliseconds for the registration ceremony.
string
Attestation conveyance preference ('none', 'indirect', 'direct').
object[]
List of existing credential descriptors to prevent re-registration.

webauthn.registerVerify()

Verify a WebAuthn registration response from the browser. On success, the credential is stored and associated with the principal.

Parameters

string
required
The principal ID that this credential belongs to.
object
required
The WebAuthn attestation response from navigator.credentials.create(). Must include id, rawId, type, and response (with clientDataJSON and attestationObject).

Response: WebAuthnCredential

string
Unique credential identifier.
string
Base64url-encoded public key.
number
The signature counter (starts at 0).
string
ISO 8601 timestamp when the credential was registered.
string
The authenticator attestation GUID, identifying the authenticator model.

webauthn.listCredentials()

List all WebAuthn credentials registered for a principal.

Parameters

string
required
The principal ID to list credentials for.

Response: WebAuthnCredential[]

Returns an array of WebAuthnCredential objects.
string
Unique credential identifier.
string
Base64url-encoded public key.
number
Current signature counter value.
string
ISO 8601 timestamp when the credential was registered.
string | null
ISO 8601 timestamp of the last successful authentication, or null if never used.

webauthn.deleteCredential()

Delete a WebAuthn credential by its ID. The credential is immediately invalidated.

Parameters

string
required
The credential ID to delete.

Response

Returns void. The credential is immediately removed and can no longer be used for authentication.

Full example

Last modified on March 8, 2026