Skip to main content
Expo and React Native support is a new feature in v0.3 with specialized providers for mobile environments.

Overview

React Native and Expo applications require special handling for:
  • Server-Sent Events (SSE): Standard EventSource doesn’t work in React Native
  • Streaming: JSON streaming requires custom fetch implementation
  • Cryptography: crypto.getRandomValues() polyfill is required
The v0.3 SDK provides Expo-compatible providers that handle these requirements automatically.

Installation

First, install the required dependencies:

Crypto Polyfill Setup

You must polyfill crypto.getRandomValues() before importing the SDK. This is required for MuSig2 settlements and cryptographic operations.
Add this at the top of your app entry point (before any SDK imports):

Basic Setup

Create a wallet with Expo-compatible providers:

Understanding Expo Providers

The SDK includes two specialized providers for Expo/React Native:

ExpoArkProvider

Handles settlement events and transaction streaming using expo/fetch for Server-Sent Events:

ExpoIndexerProvider

Handles address subscriptions and VTXO updates using expo/fetch for JSON streaming:
Both providers follow the SDK’s modular architecture pattern, keeping the main bundle clean while providing opt-in functionality for specific environments.

Complete Example

Here’s a complete React Native component with wallet integration:

Using AsyncStorage

First install:
For persistent storage in React Native, use AsyncStorageAdapter:

Common Issues

Crypto Not Defined

Error: crypto is not defined or crypto.getRandomValues is not a function Solution: Ensure the crypto polyfill is set up before importing the SDK:

EventSource Not Available

Error: EventSource is not defined Solution: Use ExpoArkProvider and ExpoIndexerProvider instead of default providers:

AsyncStorage Errors

Error: AsyncStorage is null Solution: Make sure you’re using AsyncStorageAdapter from the SDK:

Testing on Devices

When testing on physical devices or emulators:
  1. Make sure your device can reach the Arkade server URL
  2. Use a publicly accessible server (not localhost)
  3. Check network permissions in your app configuration