Overview
This guide shows how to implement passkey authentication in a React Native app using@turnkey/react-native-wallet-kit
.
You’ll add the necessary platform configuration, set up the provider with a proper rpId
, and call loginWithPasskey
and signUpWithPasskey
from your UI.
Passkey Setup
To enable passkeys, you must configure your app’sapp.json
file and set up an associated domain.
For details on setting up Apple’s Associated Domains, refer to Apple’s Documentation.
For Android, you must configure Digital Asset Links by setting up an assetlinks.json
file. Refer to Google’s Documentation.
1. Update app.json
with associated domains
2. Ensure rpId
is set correctly in your Turnkey provider configuration
Set the passkeyConfig.rpId
to the domain you’ve associated (for example, yourdomain.com
). This should match the domain configured in Associated Domains (iOS) and Digital Asset Links (Android).
constants/turnkey.ts
Usage
Below are examples based on the sample app to sign up and log in with passkeys using Expo Router.Sign up with passkey
app/index.tsx
Log in with passkey
app/index.tsx
Tips
- Ensure your
rpId
matches the domain configured in your platform setup; otherwise passkey operations may fail. - On iOS, confirm your provisioning profile includes Associated Domains and your app build contains the entitlements.
- On Android, deploy a valid
assetlinks.json
athttps://<your_domain>/.well-known/assetlinks.json
that grants your application signature permission. - Consider setting a dynamic
passkeyDisplayName
on sign-up (e.g.,${AppName}-${timestamp}
) if you want to help users identify authenticators later.