UNPKG

capacitor-biometric-authentication

Version:

Framework-agnostic biometric authentication library. Works with React, Vue, Angular, or vanilla JS. No providers required!

38 lines (37 loc) 1.55 kB
import { WebAuthnCreateOptions, WebAuthnGetOptions } from '../definitions'; /** * Convert various input formats to ArrayBuffer for WebAuthn API */ export declare function toArrayBuffer(data: ArrayBuffer | Uint8Array | string | undefined): ArrayBuffer | undefined; /** * Convert ArrayBuffer to base64 string for storage */ export declare function arrayBufferToBase64(buffer: ArrayBuffer): string; /** * Convert ArrayBuffer to base64url string (WebAuthn standard) */ export declare function arrayBufferToBase64URL(buffer: ArrayBuffer): string; /** * Generate a cryptographically secure random challenge */ export declare function generateChallenge(): ArrayBuffer; /** * Merge user-provided WebAuthn create options with defaults */ export declare function mergeCreateOptions(userOptions?: WebAuthnCreateOptions, defaults?: Partial<PublicKeyCredentialCreationOptions>): PublicKeyCredentialCreationOptions; /** * Merge user-provided WebAuthn get options with defaults */ export declare function mergeGetOptions(userOptions?: WebAuthnGetOptions, defaults?: Partial<PublicKeyCredentialRequestOptions>): PublicKeyCredentialRequestOptions; /** * Store credential ID in localStorage for future authentication */ export declare function storeCredentialId(credentialId: string, userId?: string): void; /** * Get stored credential IDs from localStorage */ export declare function getStoredCredentialIds(userId?: string): string[]; /** * Clear stored credential IDs */ export declare function clearStoredCredentialIds(userId?: string): void;