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

# React Native

> Add the Agentcard wallet to your React Native app with @agentcard/wallet-react-native.

This is the wallet for React Native apps. It's one component: you give it a wallet link, it renders the wallet, and you get the same events the web SDK fires.

## Install

```bash theme={null}
npm install @agentcard/wallet-react-native react-native-webview
```

The package is private while the SDK is in early access, so the install fails until your team has access. Write to us and we'll set you up.

## Create a wallet link (server side)

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.agentcard.sh/api/v2/wallet_links \
    -H "Authorization: Bearer $ORG_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"user_id": "USER_ID"}'
  ```

  ```javascript Node theme={null}
  const res = await fetch("https://api.agentcard.sh/api/v2/wallet_links", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${ORG_TOKEN}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ user_id: "USER_ID" }),
  });
  const link = await res.json();
  ```

  ```python Python theme={null}
  import requests

  res = requests.post(
      "https://api.agentcard.sh/api/v2/wallet_links",
      headers={"Authorization": f"Bearer {ORG_TOKEN}"},
      json={"user_id": "USER_ID"},
  )
  link = res.json()
  ```
</CodeGroup>

The response includes a `url`. Hand it to your app. Links expire after 15 minutes by default (`expires_in` accepts 60 to 86400 seconds).

## Render the wallet

```tsx theme={null}
import { AgentcardWallet } from "@agentcard/wallet-react-native";

<AgentcardWallet
  link={walletLinkUrl}
  onSuccess={(data) => {
    // data.type is "card_attached" or "payment_completed"
  }}
  onTokenExpired={() => {
    // fetch a fresh wallet link from your server and swap the `link` prop
  }}
/>
```

To ask for a payment instead of opening the wallet home:

```tsx theme={null}
<AgentcardWallet
  link={walletLinkUrl}
  pay={{ amountCents: 500, merchant: "Amazon" }}
  onSuccess={(data) => {}}
/>
```

The component accepts `link` as either the full URL or the raw token. `onEvent(name, data)` receives every bridge event if you want analytics, and `style` sizes the view.

## Webhooks you will receive

Component events are UI signals. Your server should trust webhooks:

* `connected_card.updated` when the user adds a card
* `transaction.*` events when payments happen

## When it fails

When the link or its session dies, `onTokenExpired` fires: create a fresh wallet link and swap the `link` prop. Bank approvals open in the system browser by default; override that with `onOpenUrl(url)` if you want an in-app browser. Passkey prompts need iOS 17 or later inside a WebView, so older devices fall back to code verification.

## Sandbox behavior

With sandbox credentials, the connect code is always `111111` and the test card is `4242 4242 4242 4242` with any future expiry and any CVC. No real money moves.

Next: [Connect users](/wallet/connect-users)
