Skip to main content

Latest React Native SDK version - npm

The Crossmint React Native SDK (@crossmint/client-sdk-react-native-ui) provides CrossmintEmbeddedOfframp, which renders the Crossmint offramp in a WebView, so your users can withdraw stablecoins from their wallet to their bank account. Create the session on your server with Create Offramp Session. To pay from a Crossmint wallet, use the wallet providers and hooks of the Wallets React Native SDK.

Installation

The SDK needs Expo SDK 58. npx expo install picks the versions of these packages that match your Expo SDK.

Provider Setup

Wrap your application with the required providers:
Note: Add CrossmintWalletProvider only to pay from a Crossmint wallet, and pass your auth provider’s JWT to Crossmint with setJwt. The offramp session needs a wallet owned by userId:<USER_ID>, where <USER_ID> is the sub of your auth provider’s JWT. See Use Your Own Auth Provider.

Quick Example

Once providers are set up, render the offramp with the credentials of a session that your server created:
Note: The user must be signed in, with your auth provider’s JWT passed to setJwt, before getWallet can load the wallet. See Use Your Own Auth Provider. Create the session on your server with Create Offramp Session, because it needs your server-side API key. Pass the sessionId and clientSecret it returns as credentials.

Next Steps