@getpara/react-native-wallet package that works seamlessly in both React Native bare and Expo workflows.
Prerequisites
To use Para, you need an API key. This key authenticates your requests to Para services and is essential for integration.Dependency Installation
Install the required dependencies:Project Setup
If you plan to use native passkeys, additional platform configuration (associated domains, SHA-256 fingerprints) is required. See for iOS and Android setup.
Configure Metro Bundler
Create or updatemetro.config.js so Metro knows how to resolve the Node polyfills Para depends on (for example crypto and buffer). For more details on Metro configuration, see the .
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.
Initialize the SDK
Set up the Para client singleton and initialize it in your app:para.ts
app/_layout.tsx
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.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/Examples
Troubleshooting
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 prebuildto generate native code. - Run
expo run:iosandexpo run:androidto rebuild your app after adding new native dependencies. - Verify that your
app.jsonfile includes the necessary configurations for native modules.
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 (
BETAorPRODUCTION) 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.
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 doctorto check for any configuration issues in your project. - For EAS builds, check your
eas.jsonconfiguration and ensure it’s set up correctly for both iOS and Android.