The `expo-better-auth-passkey` package provides native passkey (WebAuthn) support for applications built with Expo and `better-auth`. It acts as a drop-in replacement for `better-auth`'s standard `passkeyClient`, leveraging platform-specific APIs like Apple's `ASAuthorizationController` for iOS/macOS and Android's Credential Manager. This ensures a consistent passkey experience across web, iOS, and Android using a single codebase. The library, currently at version 1.4.1, maintains an active release schedule with updates addressing bug fixes and new features. Key differentiators include its seamless integration into both managed and bare Expo projects without requiring ejecting, a smart fallback to the web client for web builds, and a TypeScript-first approach with strict type mirroring for robust development.
npm install expo-better-auth-passkeyVerified import paths — ran on the pinned version, not inferred.
Initializes a Better Auth client with native passkey support for Expo apps and demonstrates basic passkey registration and sign-in operations across supported platforms.
Review the official `better-auth` and `expo-better-auth-passkey` documentation for the updated parameter structures, specifically for `authClient.passkey.addPasskey()` and `authClient.signIn.passkey()`.
Add `webcredentials:your-auth-domain.com` to `ios.associatedDomains` in your `app.json` and ensure the `apple-app-site-association` file is correctly hosted and accessible at `https://your-auth-domain.com/.well-known/apple-app-site-association`.
Inform users about the Google Play Services requirement or gracefully degrade to alternative authentication methods if the device doesn't meet the minimum version.
Verify `rpID` matches your domain, `origin` is correct, and add `android:apk-key-hash:<BASE64_SHA256>` for all signing certificates to your Better Auth server passkey plugin configuration. Include all app schemes (e.g., `myapp://`, `https://localhost`) in `trustedOrigins`.
Ensure your `baseURL` and `origin` configurations on both client and server sides use HTTPS. For local development, set up HTTPS for your local server or use a tunnel for your API endpoint.
Upgrade to `expo-better-auth-passkey@1.4.1` or newer to ensure correct `presentationAnchor` behavior and improve stability for native passkey interactions.
Verify `ios.associatedDomains` in `app.json` includes `webcredentials:your-rp-id.com` and that the `apple-app-site-association` file is correctly hosted and accessible at `https://your-rp-id.com/.well-known/apple-app-site-association`.
Cross-reference `rpID`, `rpName`, and `origin` values on your Better Auth server configuration with your app's domain. Ensure all client app schemes (e.g., `myapp://`, `https://localhost`) are explicitly included in `trustedOrigins` on the server.
Generate the correct Base64 SHA256 hash of your Android app's signing certificate and add it to the `android:apk-key-hash` array in your Better Auth server passkey plugin configuration.
Ensure `expoPasskeyClient()` is included in the `plugins` array passed to `createAuthClient({ plugins: [...] })` and that `authClient` is initialized before attempting passkey operations.