Skip to main content

Latest React SDK version - npm

The Crossmint React SDK (@crossmint/client-sdk-react-ui) provides CrossmintEmbeddedOfframp, which renders the Crossmint offramp in an iframe, 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 SDK.

Installation

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