> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# React Native - Webview

> Embed a card checkout for tokens or NFTs into a React Native app

<Snippet file="enterprise-feature.mdx" />

# Crossmint Checkout React Native SDK Quickstart

> [!NOTE]
>
> This example sells a token. For NFTs, pass `collectionLocator: "crossmint:<collectionId>"` and `callData: { totalPrice, quantity }` in `lineItems` instead — see the [React quickstart](https://docs.crossmint.com/payments/embedded/quickstarts/credit-card.md) for the NFT variant.

> [!NOTE]
>
> This quickstart uses Expo. You can follow this [tutorial](https://docs.expo.dev/tutorial/create-your-first-app/) to create an expo app. **Only do steps 1 and 3**, plus the Crossmint-specific steps below.
>
> **Prerequisites:** Before starting, ensure you have completed the [Expo prerequisites](https://docs.expo.dev/tutorial/create-your-first-app/#prerequisites) including Node.js, Git, and your development environment setup.

> [!NOTE]
>
> To integrate without the SDK, or on a platform the SDKs do not cover, render the checkout URL in your own WebView
> following the [Mobile WebView Integration guide](https://docs.crossmint.com/payments/embedded/guides/webview-integration.md).

## Following Expo Tutorial + Crossmint SDK

**1. Initialize a new Expo app**

```bash theme={null}
npx create-expo-app@latest crossmint-checkout-quickstart

cd crossmint-checkout-quickstart
```

**2. Run reset-project script**

```bash theme={null}
npm run reset-project
```

**3. Install @crossmint/client-sdk-react-native-ui**

<Snippet file="client-sdk-react-native-ui-installation-cmd.mdx" />

**4. Add your .env.local environment variables**

```bash theme={null}
EXPO_PUBLIC_CLIENT_CROSSMINT_API_KEY="your_client_side_api_key"
EXPO_PUBLIC_RECIPIENT_WALLET_ADDRESS="your_solana_wallet_address"
EXPO_PUBLIC_RECEIPT_EMAIL="your-email@example.com"
```

> [!NOTE]
>
> The `receiptEmail` field is **optional**. If the buyer pays with Apple Pay or Google Pay, Crossmint obtains the
> email automatically. Providing it improves fraud signal quality.

**5. Replace index.tsx with**

```jsx theme={null}
import { CrossmintEmbeddedCheckout, CrossmintProvider } from "@crossmint/client-sdk-react-native-ui";

export default function Index() {
    return (
        <CrossmintProvider apiKey={process.env.EXPO_PUBLIC_CLIENT_CROSSMINT_API_KEY ?? ""}>
            <CrossmintEmbeddedCheckout
                recipient={{
                    walletAddress: process.env.EXPO_PUBLIC_RECIPIENT_WALLET_ADDRESS ?? "",
                }}
                payment={{
                    crypto: {
                        enabled: false,
                    },
                    fiat: {
                        enabled: true,
                    },
                    receiptEmail: process.env.EXPO_PUBLIC_RECEIPT_EMAIL ?? "",
                }}
                lineItems={{
                    tokenLocator: "solana:7EivYFyNfgGj8xbUymR7J4LuxUHLKRzpLaERHLvi7Dgu", // XMEME token (staging)
                    executionParameters: {
                        mode: "exact-in", // Specifies exact USD amount to spend (vs exact-out for NFTs)
                        amount: "1", // USD amount to spend
                        maxSlippageBps: "500", // Maximum slippage tolerance in basis points (500 = 5%, default if not specified)
                    },
                }}
            />
        </CrossmintProvider>
    );
}
```

**6. Run your project**

```bash npm theme={null}
npm run ios
# For Android:
npm run android
```

```bash yarn theme={null}
yarn ios
# For Android:
yarn android
```

```bash pnpm theme={null}
pnpm ios
# For Android:
pnpm android
```

```bash bun theme={null}
bun ios
# For Android:
bun android
```

### Result

![React Native Crossmint Checkout Result](https://mintcdn.com/crossmint/QK6rWfcUCMmvIQPT/images/payments/embedded/quickstarts/react-native/checkout-result.png?fit=max\&auto=format\&n=QK6rWfcUCMmvIQPT\&q=85\&s=6603d26b9aa1a8c689ddcd6fa5dca039)

## Testing Your App

Test purchases in staging using test credit cards, like `4242424242424242` (Visa). More information on testing can be found [here](https://docs.crossmint.com/payments/advanced/testing-tips.md#test-credit-card-numbers). This demo is built on staging — to launch on production, check the [production checklist](https://docs.crossmint.com/payments/guides/production-checklist.md).

## Next Steps

> [card] [Mobile WebView Integration](https://docs.crossmint.com/payments/embedded/guides/webview-integration.md)
>
> Render the checkout in your own WebView without the SDK

> [card] [React Native SDK Reference](https://docs.crossmint.com/sdk-reference/checkout/react-native/get-started.md)
>
> Full API reference for the React Native SDK
