Skip to main content

Requirements

  • React Native 0.72+
  • Expo SDK 54+ (recommended)
  • iOS 16+ / Android 9+
  • A Cavos App ID from the Dashboard

Installation

npm install @cavos/react-native starknet

Peer Dependencies

The SDK requires these Expo packages:
npx expo install expo-crypto expo-secure-store react-native-passkey
PackagePurpose
expo-cryptoCryptographic operations
expo-secure-storeSecure key storage (Keychain/Keystore)
react-native-passkeyNative passkey support

Configuration

Required: rpId

The React Native SDK requires an rpId (Relying Party ID). This is the domain that validates your passkeys.
import { CavosNativeProvider } from '@cavos/react-native';

const config = {
  appId: 'your-app-id',
  rpId: 'app.yourcompany.com', // Required for passkeys
  network: 'sepolia',
};

export default function App() {
  return (
    <CavosNativeProvider config={config}>
      <MainScreen />
    </CavosNativeProvider>
  );
}
The rpId must be a valid domain that hosts association files. See Domain Association for setup instructions.

Configuration Options

PropertyTypeRequiredDefaultDescription
appIdstringYes-Your Cavos App ID
rpIdstringYes-Domain for passkey validation
network’sepolia’ | ‘mainnet’No’sepolia’Target Starknet network
paymasterApiKeystringNoCavos shared keyCustom AVNU Paymaster API key
starknetRpcUrlstringNoAlchemy RPCCustom Starknet RPC URL

Expo Configuration

app.json / app.config.js

Configure associated domains for passkey support:
{
  "expo": {
    "ios": {
      "bundleIdentifier": "com.yourcompany.yourapp",
      "associatedDomains": [
        "webcredentials:app.yourcompany.com"
      ]
    },
    "android": {
      "package": "com.yourcompany.yourapp"
    }
  }
}

Development Build

Passkeys require a development build (not Expo Go):
# Create development build
npx expo prebuild

# Run on iOS
npx expo run:ios

# Run on Android  
npx expo run:android
Passkeys do not work in Expo Go. You must use a development build or production build.

Exports

The package exports:
ExportDescription
CavosNativeProviderReact context provider
useCavosNativeMain hook for SDK access
CavosNativeSDKDirect SDK class (advanced)