UNPKG

expo-passkey

Version:

Passkey authentication for Expo apps with Better Auth integration

45 lines 1.65 kB
/** * @file WebAuthn utility functions * @module expo-passkey/client/utils/webauthn */ import type { AuthenticatorSelectionCriteria, PublicKeyCredentialCreationOptions, PublicKeyCredentialRequestOptions, WebAuthnSupportInfo } from "../../types"; /** * Checks if the device supports WebAuthn */ export declare function checkWebAuthnSupport(): WebAuthnSupportInfo; /** * Create registration options for WebAuthn */ export declare function createRegistrationOptions(challenge: string, userId: string, userName: string, displayName: string, rpId: string, rpName: string, options?: { timeout?: number; attestation?: "none" | "indirect" | "direct" | "enterprise"; authenticatorSelection?: AuthenticatorSelectionCriteria; excludeCredentials?: Array<{ id: string; type: "public-key"; }>; }): PublicKeyCredentialCreationOptions; /** * Create authentication options for WebAuthn */ export declare function createAuthenticationOptions(challenge: string, rpId: string, options?: { timeout?: number; userVerification?: "required" | "preferred" | "discouraged"; allowCredentials?: Array<{ id: string; type: "public-key"; }>; }): PublicKeyCredentialRequestOptions; /** * Convert ArrayBuffer to base64url string */ export declare function bufferToBase64url(buffer: ArrayBuffer): string; /** * Convert base64url string to ArrayBuffer */ export declare function base64urlToBuffer(base64url: string): ArrayBuffer; /** * Sets the device info reference for internal use */ export declare function setDeviceInfo(info: WebAuthnSupportInfo): void; //# sourceMappingURL=webauthn.d.ts.map