import { CryptoProvider } from "cojson"; import { AuthSecretStorage, AuthenticateAccountFunction } from "jazz-tools"; interface PasskeyCreateRequest { challenge: string; rp: { id: string; name: string; }; user: { id: string; name: string; displayName: string; }; pubKeyCredParams: Array<{ alg: number; type: "public-key"; }>; authenticatorSelection?: { authenticatorAttachment?: "platform" | "cross-platform"; requireResidentKey?: boolean; residentKey?: "discouraged" | "preferred" | "required"; userVerification?: "discouraged" | "preferred" | "required"; }; timeout?: number; attestation?: "none" | "indirect" | "direct" | "enterprise"; } interface PasskeyGetRequest { challenge: string; rpId: string; allowCredentials?: Array<{ id: string; type: "public-key"; transports?: Array<"usb" | "nfc" | "ble" | "internal" | "hybrid">; }>; timeout?: number; userVerification?: "discouraged" | "preferred" | "required"; } interface PasskeyGetResult { id: string; rawId: string; type: "public-key"; response: { clientDataJSON: string; authenticatorData: string; signature: string; userHandle: string | null; }; } /** * Interface for the react-native-passkey module. * @internal */ export interface PasskeyModule { create: (request: PasskeyCreateRequest) => Promise; get: (request: PasskeyGetRequest) => Promise; isSupported: () => Promise; } /** * Lazily loads the react-native-passkey module. * This allows the module to be an optional peer dependency. * @internal */ export declare function getPasskeyModule(): PasskeyModule; /** * Sets a custom passkey module (for testing purposes). * @internal */ export declare function setPasskeyModule(module: PasskeyModule | null): void; /** * Check if passkeys are supported on the current device. * Returns false if the react-native-passkey module is not available or if the device doesn't support passkeys. */ export declare function isPasskeySupported(): Promise; /** * `ReactNativePasskeyAuth` provides passkey (WebAuthn) authentication for React Native apps. * * This class uses the device's biometric authentication (FaceID/TouchID/fingerprint) to * securely store and retrieve Jazz account credentials. * * **Requirements:** * - Install `react-native-passkey` as a peer dependency * - Configure your app's associated domains (iOS) and asset links (Android) * - Passkeys require HTTPS domain verification * * ```ts * import { ReactNativePasskeyAuth } from "jazz-tools/react-native-core"; * * const auth = new ReactNativePasskeyAuth( * crypto, * authenticate, * authSecretStorage, * "My App", * "myapp.com" * ); * ``` * * @category Auth Providers */ export declare class ReactNativePasskeyAuth { protected crypto: CryptoProvider; protected authenticate: AuthenticateAccountFunction; protected authSecretStorage: AuthSecretStorage; appName: string; rpId: string; constructor(crypto: CryptoProvider, authenticate: AuthenticateAccountFunction, authSecretStorage: AuthSecretStorage, appName: string, rpId: string); static readonly id = "passkey"; /** * Log in using an existing passkey. * This will prompt the user to authenticate with their device biometrics. */ logIn: () => Promise; /** * Register a new passkey for the current account. * This will create a passkey that stores the account credentials securely on the device. * * @param username - The display name for the passkey */ signUp: (username: string) => Promise; private createPasskeyCredentials; private getPasskeyCredentials; } export {}; //# sourceMappingURL=PasskeyAuth.d.ts.map