@crossmint/client-sdk-react-native-ui
React Native SDK for integrating Crossmint Wallets into your mobile application. Provides providers, hooks, and built-in UI for wallet creation, signing, and OTP verification.
Prerequisites
Get a client API key from the Crossmint developer console. Ensure your key has the Wallet API scopes enabled, including wallets.fund for stagingFund.
Installation
npx expo install @crossmint/client-sdk-react-native-ui expo-constants expo-device expo-secure-store expo-web-browser react-native-get-random-values react-native-webview
The SDK requires Expo SDK 58 (React Native 0.88, iOS 16.4 or later). The native modules are peer dependencies, and npx expo install picks the versions that match your Expo SDK.
Xcode 27 and iOS 27
Apps built with Xcode 27 (the iOS 27 SDK) must use the UIKit scene lifecycle. If they do not, they stop at launch with "UIScene life cycle is required for apps built with this SDK". Expo SDK 58 generates it: npx expo prebuild adds a SceneDelegate.swift and a scene manifest to Info.plist. No configuration is needed, and the Crossmint config plugin works with it.
After you upgrade to Expo SDK 58, regenerate the native project. If your app generates ios/ and android/ (continuous native generation), run npx expo prebuild --clean. If you maintain those folders by hand, --clean deletes your changes; apply the scene lifecycle changes to your own AppDelegate and Info.plist instead, as described in Expo's iOS scene lifecycle guide.
If your app config still sets ios.enableSceneSupport in expo-build-properties, you can remove it. It has no effect on Expo SDK 58.
Quick Start
1. Setup Providers
With Crossmint Auth (default in staging)
import {
CrossmintProvider,
CrossmintAuthProvider,
CrossmintWalletProvider,
} from "@crossmint/client-sdk-react-native-ui";
export default function App() {
return (
<CrossmintProvider apiKey={process.env.EXPO_PUBLIC_CROSSMINT_API_KEY}>
<CrossmintAuthProvider>
<CrossmintWalletProvider
createOnLogin={{
chain: "base-sepolia",
recoveryMethods: [{ type: "email" }],
}}
>
<MainApp />
</CrossmintWalletProvider>
</CrossmintAuthProvider>
</CrossmintProvider>
);
}
Bring Your Own Authentication
Use this when your app already has an auth provider, and in production: connect your provider and configure JWT Authentication in the Crossmint Console (see Move to Production). Then skip CrossmintAuthProvider and pass your provider's JWT to the wallets SDK. See the Custom Auth Guide for full details.
import {
CrossmintProvider,
CrossmintWalletProvider,
} from "@crossmint/client-sdk-react-native-ui";
export default function App() {
return (
<CrossmintProvider apiKey={process.env.EXPO_PUBLIC_CROSSMINT_API_KEY}>
<CrossmintWalletProvider
createOnLogin={{
chain: "base-sepolia",
recoveryMethods: [
{
type: "email",
email: "[email protected]",
},
],
}}
>
<MainApp />
</CrossmintWalletProvider>
</CrossmintProvider>
);
}
2. Use Wallets
import { useWallet } from "@crossmint/client-sdk-react-native-ui";
import { View, Text, TouchableOpacity } from "react-native";
function WalletActions() {
const { wallet, status } = useWallet();
if (status === "in-progress") return <Text>Loading wallet...</Text>;
if (!wallet) return <Text>No wallet</Text>;
// Staging only: mints USDXM, Crossmint's test stablecoin, into the wallet
const handleFund = async () => {
await wallet.stagingFund(10);
};
const handleSend = async () => {
const tx = await wallet.send("0xRecipient", "usdxm", "10");
console.log("Transaction:", tx.explorerLink);
};
return (
<View>
<Text>Wallet: {wallet.address}</Text>
<TouchableOpacity onPress={handleFund}>
<Text>Get 10 USDXM</Text>
</TouchableOpacity>
<TouchableOpacity onPress={handleSend}>
<Text>Send 10 USDXM</Text>
</TouchableOpacity>
</View>
);
}
Providers
| Provider | Purpose |
|---|---|
CrossmintProvider | Root provider. Required for all Crossmint features. |
CrossmintAuthProvider | Authentication (OAuth). Optional if using your own auth. |
CrossmintWalletProvider | Wallet creation, device signer management, and OTP UI. |
CrossmintWalletProvider Props
| Prop | Type | Default | Description |
|---|---|---|---|
createOnLogin | CreateOnLogin | — | Auto-create wallet on auth. Uses recovery or recoveryMethods + optional signers. |
showOtpSignerPrompt | boolean | true | When true (default), built-in OTP dialogs are shown during signing flows. Set to false to suppress them and handle OTP manually via useWalletOtpSigner(). |
deviceSignerKeyStorage | DeviceSignerKeyStorage | — | Override the default native key storage. |
passkeys | NativePasskeyConfig | — | Enables passkey signers on every chain: { rpId, rpName?, passkey: Passkey }, with Passkey from react-native-passkey. Requires an app associated with rpId (iOS webcredentials: associated domain, Android Digital Asset Links) and a development build, since Expo Go cannot run native modules. Keep rpId fixed once users have created passkeys. Without this prop, passkey signers are rejected. |
appearance | UIConfig | — | Styling for built-in UI components. |
Hooks
useWallet()
Returns the wallet instance and management functions:
const {
wallet, // Wallet | undefined
status, // "not-loaded" | "in-progress" | "loaded" | "error"
getWallet, // (props: { chain, alias? }) => Promise<Wallet | undefined>
createWallet, // (props: ClientSideWalletCreateArgs) => Promise<Wallet | undefined>
createDeviceSigner, // () => Promise<DeviceSignerDescriptor> | undefined
createPasskeySigner, // (name: string) => Promise<RegisterSignerPasskeyParams>
} = useWallet();
useWalletOtpSigner()
For custom OTP UI when using email/phone recovery methods. When showOtpSignerPrompt is set to false, use this hook to handle OTP flows manually:
const { needsAuth, sendOtp, verifyOtp, reject } = useWalletOtpSigner();
useCrossmintAuth()
Authentication state and OAuth login:
const { loginWithOAuth, logout, user } = useCrossmintAuth();
// OAuth providers
loginWithOAuth("google");
loginWithOAuth("twitter");
Components
ExportPrivateKeyButton
Renders a button to export the wallet's private key via TEE. Only renders for email/phone signers.
import { ExportPrivateKeyButton } from "@crossmint/client-sdk-react-native-ui";
<ExportPrivateKeyButton appearance={{ borderRadius: "12px" }} />
Differences from React SDK
| Feature | React | React Native |
|---|---|---|
| Device signer storage | Browser iframe (IframeDeviceSignerKeyStorage) | Native secure storage (iOS Secure Enclave / Android Keystore) |
| Device storage override | Not exposed | deviceSignerKeyStorage prop on provider |
| Built-in OTP UI | Always rendered | showOtpSignerPrompt=true (shown by default) |
| Passkey helper UI | showPasskeyHelpers prop | Not available |
| TEE communication | Hidden iframe | Hidden WebView (lazily initialized) |
Wallets SDK
The wallet object returned by useWallet() is a Wallet instance. For wallet method documentation (send, balances, sign, etc.), see the @crossmint/wallets-sdk README.
Environment Setup
-
Get your API key from Crossmint Console
-
Add to your
.env:
EXPO_PUBLIC_CROSSMINT_API_KEY=your_api_key_here
- Configure deep linking in
app.json:
{
"expo": {
"scheme": "your-app-scheme"
}
}
Documentation
License
Apache-2.0