Class

WebauthnManager

WebauthnManager()

Manages WebAuthn credential operations as a singleton, ensuring only one active request at a time. Uses an internal AbortController to cancel previous requests when a new one is initiated.
Constructor

# new WebauthnManager()

View Source lib/flow-api/WebauthnManager.ts, line 7

Methods

# static getInstance() → {WebauthnManager}

Gets the singleton instance of WebauthnManager. Creates a new instance if one doesn't exist, otherwise returns the existing one.

View Source lib/flow-api/WebauthnManager.ts, line 85

The singleton instance

# async createWebauthnCredential(options) → {Promise.<PublicKeyCredentialWithAttestationJSON>}

Creates a new WebAuthn credential using the provided options. Aborts any previous request before starting a new one.
Parameters:
Name Type Description
options CredentialCreationOptionsJSON The options for credential creation

View Source lib/flow-api/WebauthnManager.ts, line 126

If the WebAuthn request fails (e.g., aborted, not allowed)
DOMException
A promise resolving to the created credential
Promise.<PublicKeyCredentialWithAttestationJSON>

# async getConditionalWebauthnCredential(publicKey) → {Promise.<PublicKeyCredentialWithAssertionJSON>}

Retrieves a WebAuthn credential with conditional UI mediation. Aborts any previous request before starting a new one.
Parameters:
Name Type Description
publicKey CredentialRequestOptionsJSON The public key options for conditional retrieval

View Source lib/flow-api/WebauthnManager.ts, line 115

If the WebAuthn request fails (e.g., aborted, not allowed)
DOMException
A promise resolving to the retrieved credential
Promise.<PublicKeyCredentialWithAssertionJSON>

# async getWebauthnCredential(options) → {Promise.<PublicKeyCredentialWithAssertionJSON>}

Retrieves a WebAuthn credential using the provided options. Aborts any previous request before starting a new one.
Parameters:
Name Type Description
options CredentialRequestOptionsJSON The options for credential retrieval

View Source lib/flow-api/WebauthnManager.ts, line 104

If the WebAuthn request fails (e.g., aborted, not allowed)
DOMException
A promise resolving to the retrieved credential
Promise.<PublicKeyCredentialWithAssertionJSON>