@getpara/react-native-wallet
@alpha package that works seamlessly in both React Native bare and Expo workflows, utilizing the device’s Native Passkeys for secure wallet management.
Prerequisites
To use Para, you need an API key. This key authenticates your requests to Para services and is essential for integration.Don’t have an API key yet? Request access to the Developer Portal to create API keys, manage billing, teams, and more.
To ensure passkey functionality works correctly:
- Enable biometric or device unlock settings (fingerprint, face unlock, or PIN)
- On Android sign in to a Google account on the device (required for Google Play Services passkey management)
Dependency Installation
Install the required dependencies:Project Setup
To use the@getpara/react-native-wallet
@alpha package in your Expo project, you will need to do some initial project setup.
For passkeys to work correctly we have to setup the Relying Party ID for both iOS and Android. This ensures passkeys are bound to the domains they were created for.
Your apps must be registered with Para to link the passkey to the correct domain. You can find this configuration options
your Developer Portal under the ‘Configuration’ tab of the API key label as Native Passkey Configuration.
Platform-Specific Configuration
Configure your
app.json
file to enable passkey functionality and secure communication:app.json
Important: Your
teamId + bundleIdentifier
must be registered with the Para team to set up associated domains. For example, if your Team ID is A1B2C3D4E5
and Bundle Identifier is com.yourdomain.yourapp
, provide A1B2C3D4E5.com.yourdomain.yourapp
to Para. This is required by Apple for passkey security. Allow up to 24 hours for domain propagation. You can find this setting in the Developer Portal under the ‘Configuration’ tab of the API key label as Native Passkey Configuration.Configure Metro Bundler
Create or updatemetro.config.js
in your project with the following node module resolutions. This will ensure that any library that depends on global modules like crypto
or buffer
will be properly resolved in the Expo environment. For more details on Metro configuration, see the official Expo Metro documentation.
metro.config.js
Import Required Shims
Import the Para Wallet shim in your root layout file to ensure proper global module shimming. This ensures that the necessary modules are available globally in your application. Ensure this is the very first import in your root layout file.app/_layout.tsx
Alternatively, you can create a custom entry point to handle the shimming. This will ensure that the shim occurs before the Expo Router entry point.
Custom Entry Point
Custom Entry Point
Create Update
index.js
in your project root and add the following imports:index.js
package.json
to point to your new entry file:package.json
Prebuild and Run
Since native modules are required, you’ll need to use Expo Development Build to ensure that linking is successful. This means using theexpo prebuild
command to generate the necessary native code and then run your app using expo run:ios
or expo run:android
.
You cannot use Expo Go as it doesn’t support native module linking. When running via
yarn start
, switch to development mode by pressing s
, then i
for iOS or a
for Android.Using the Para SDK
The@getpara/react-native-wallet
@alpha provides two main authentication methods: email-based and phone-based. Both flows utilize Native Passkeys for secure and seamless authentication.
On mobile Para doesn’t provide a modal component. Instead you can create your own auth screens with either email, phone
number, or oauth using the available methods in the Para SDK.
Setup the Para Client
First, set up the Para client singleton and initialize it in your app:para.ts
app/_layout.tsx
If you’re using a legacy API key (one without an environment prefix) you must provide the
Environment
as the first argument to the ParaMobile
constructor. You can retrieve your updated API key from the Para Developer Portal at https://developer.getpara.com/Beta Testing Credentials In the
BETA
Environment, you can use any email ending in @test.getpara.com
(like
dev@test.getpara.com) or US phone numbers (+1) in the format (area code)-555-xxxx
(like (425)-555-1234). Any OTP
code will work for verification with these test credentials. These credentials are for beta testing only. You can
delete test users anytime in the beta developer console to free up user slots.Authentication Methods
Examples
For practical implementations of the Para SDK in Expo environments, check out our GitHub repository:Para Expo Integration Examples
Troubleshooting
If you encounter issues during the integration or usage of the Para SDK in your Expo application, here are some common problems and their solutions:Para SDK initialization fails
Para SDK initialization fails
If you’re having trouble initializing the Para SDK:
- Ensure that you’ve called
para.init()
after creating the Para instance. - Verify that you’re using the correct API key and environment.
- Check that all necessary dependencies are installed and linked properly.
- Look for any JavaScript errors in your Expo bundler console.
Native modules are not found or linked
Native modules are not found or linked
If you’re seeing errors about missing native modules:
- Ensure you’ve run
expo prebuild
to generate native code. - Run
expo run:ios
andexpo run:android
to rebuild your app after adding new native dependencies. - Verify that your
app.json
file includes the necessary configurations for native modules.
Passkey operations fail or throw errors
Passkey operations fail or throw errors
If passkey creation, retrieval, or usage isn’t working:
- Verify that you’ve set up associated domains correctly in your
app.json
file for both iOS and Android. - Check that you’ve provided the correct SHA-256 fingerprint to the Para team for Android.
- Ensure your Expo SDK version is compatible with the Para SDK.
Crypto-related errors or undefined functions
Crypto-related errors or undefined functions
Authentication fails or API requests are rejected
Authentication fails or API requests are rejected
If you’re experiencing authentication issues:
- Double-check that your API key is correct and properly set in your environment variables.
- Verify you’re using the correct environment (
BETA
orPRODUCTION
) that matches your API key. - Ensure your account has the necessary permissions for the operations you’re attempting.
- Check your network requests for any failed API calls and examine the error messages.
- If using Expo Go, remember that some native features might not work; consider using a development build or EAS.
Expo-specific build issues
Expo-specific build issues
If you’re encountering problems during the Expo build process:
- Ensure you’re using a compatible Expo SDK version with all your dependencies.
- Run
expo doctor
to check for any configuration issues in your project. - If using managed workflow, consider switching to bare workflow for full native module support.
- For EAS builds, check your
eas.json
configuration and ensure it’s set up correctly for both iOS and Android.