react-native-passkey provides native Passkey support for React Native applications targeting iOS 15.0+ and Android API 28+. It bridges WebAuthn API calls to the native platform credential managers, enabling secure, passwordless authentication. The package is currently at version 3.3.3 and maintains an active release cadence, with several minor and patch releases in the past year addressing fixes, updates, and new features like PRF extension support and improved error handling. A key differentiator is its direct native integration, abstracting away the platform-specific complexities of FIDO2 attestation and assertion, and offering support for advanced features like `largeBlob` and `authenticatorSelection` options. It ships with TypeScript types, facilitating safer development. The library works by taking FIDO2 attestation/assertion requests (typically from a backend) and handling the native UI and cryptographic operations, returning FIDO2 results for server verification.
npm install react-native-passkeyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to check for Passkey support and initiate the creation of a new Passkey. It simulates fetching a FIDO2 attestation request from a backend and then uses `Passkey.create()` to prompt the user, subsequently sending the result back for verification. Replace `EXAMPLE_BACKEND_URL` with your actual FIDO2 server endpoint.
Review the official documentation and migration guides for v3.0.0. Ensure your FIDO2 request payloads align with the new supported options for `excludeCredentials`, `includeCredentials`, and `authenticatorSelection`.
Update your application logic to expect `largeBlob.blob` as a plain array. Ensure your backend verification also handles this change correctly. Review the TypeScript type definitions for `largeBlob`.
Upgrade to v3.3.2 or newer to receive more accurate and descriptive error messages. Implement robust `try/catch` blocks around `Passkey.create()` and `Passkey.get()` to handle specific error strings or codes that now correctly propagate.
Follow the detailed setup instructions in the README for both iOS (Xcode 'Associated Domains' capability and `apple-app-site-association` file on your domain) and Android (AndroidManifest and `assetlinks.json` file on your domain). Ensure the `team id`, `bundle identifier`, and `SHA256_cert_fingerprints` are correct.
Avoid using pre-release beta versions, or upgrade to a stable 3.x.x release (e.g., 3.0.0 or later) which includes fixes for TypeScript types and return values.
Check `Passkey.isSupported()` before attempting Passkey operations. Inform the user if their device does not meet the requirements. Consider fallback authentication methods.
Verify that your `apple-app-site-association` (iOS) or `assetlinks.json` (Android) file is correctly served at `/.well-known/` on your domain, and that its content matches your app's bundle ID/team ID (iOS) or package name/certificate SHA256 fingerprints (Android). For iOS, ensure the 'Associated Domains' capability is added in Xcode with `webcredentials:yourdomain.com`.
For iOS, navigate to your `ios` directory and run `pod install`. For both platforms, try clearing React Native caches: `npx react-native start --reset-cache`, and then rebuild your application: `npx react-native run-ios` or `npx react-native run-android`.
Ensure the `allowCredentials` array in your FIDO2 assertion request contains valid `id` values for Passkeys previously registered by the user. If the user hasn't registered a Passkey on that device, this is expected. Guide the user to register a Passkey first or use a fallback authentication method.