Install & Setup Passkey
To use embedded wallets in your React Native app, you must first connect your mobile application with your website so users can use passkeys in both your app and website.
The setup process involves installing a few React Native packages and setting up your domain’s .well-known
public endpoint.
Installation
Install the required package using your preferred package manager:
After installing the react-native-passkey package, you need to link the native packages to your project by running the following commands:
For iOS, run:
If you are using Expo, you may need to run a prebuild or create a new build:
Or use the EAS service to create a new build for your app
ReactNativeExtension Settings
To create the passkeys associated with the correct website, the appOrigin
must be added to the ReactNativeExtension.
The appOrigin will be used to create the passkeys, so make sure it matches your website, e.g., https://example.com.
OS Configuration
iOS
There are iOS-specific steps to configure Passkey support. If you have already set up an associated domain for your application, you can skip this step.
Set Up an Associated Domain for Your Application
Follow the Apple documentation to associate a domain with your application. On your webserver, set up this route:
This route should serve a static JSON object containing your team ID and bundle identifier. Example (replace XXXXXXXXXX with your team identifier and “YYY.YYYYY.YYYYYYYYYYYYYY” with your bundle ID, e.g., H123456789.com.example.mobileApp):
In Xcode, under Signing & Capabilities, add a new Capability of type Associated Domains. Now add this and replace XXXXXX with your domain (e.g., apple.com):
If you are using Expo, add the webcredentials:{{yourdomain}} to your app.json file. See the Expo documentation for more details.
Android
The Android-specific configuration is similar to iOS. If you have already set up Digital Asset Links for your application, you can skip this step.
Associate Your App with a Domain
Follow the Android documentation to associate a domain with your application. On your webserver, set up this route:
This route should serve a static JSON object containing the following information (replace with your data, and replace SHA_HEX_VALUE with the SHA256 fingerprints of your Android signing certificate):
Conclusion
By following these steps, you can successfully integrate passkey functionality with the Dynamic SDK into your React Native app
Was this page helpful?