Skip to main content
Show your users their Agentcard wallet inside your own product. Your backend mints a wallet link, your page loads one script, and the wallet renders in an overlay (or inline): card attachment, the card list, and the pay sheet all run on Agentcard’s surface inside an iframe. Card numbers never touch your page or your servers, so your PCI scope stays exactly where it is: nowhere. The same wallet link works two ways. Text it to the user and it opens the hosted wallet page (an App Clip on iOS). Drop it into the SDK and the wallet opens inside your product. One mint, both surfaces.
The Wallet SDK is rolling out with design partners. It needs two things on your organization: wallet links enabled, and your page’s origin registered for embedding. Contact us and we will switch both on.

The shape

  1. Your server mints a wallet link for a connected user: POST /api/v2/wallet_links with your client-credentials token.
  2. Your page passes the link to AgentCard.create() and calls open().
  3. The user attaches a card or approves a payment inside the sheet.
  4. Your server hears the results on webhooks: connection.created, connected_card.updated, card.*, wallet_link.opened. Treat SDK events as UI signals and webhooks as the truth.

Quick start

Load the SDK from Agentcard on every page that uses it. Do not bundle or self-host the file: it is versioned at /js/v1/ and updates itself, which is how fixes reach your users without you shipping anything.
Mint the link server-side, hand its URL to the page, and open the wallet:
That is the whole integration. The link is safe to expose to the browser: it is a short-lived capability scoped to that one user’s wallet, not an API credential, and it expires (15 minutes by default, configurable with expires_in).

Opening the pay sheet

When your agent needs the user to approve a specific payment, open the wallet with a pay intent. The user picks a card and confirms the amount in one step:
Some banks ask for an extra approval step. The SDK opens the bank’s page in a new tab (it cannot render inside a frame; banks forbid that) and the sheet waits with a check button until the approval lands. If the browser blocks the automatic tab, the sheet shows a “Continue to your bank” button instead, so the user is never stuck.

AgentCard.create(config)

The returned handler: open() shows the overlay, mount(el) renders inline in your element, update(config) swaps the token or pay intent, exit() closes the overlay, destroy() removes everything and stops listening.

Events

Every event also arrives on onEvent(name, data):

iOS, fully native

For iMessage-adjacent and native apps, AgentcardWalletKit renders the same wallet with native SwiftUI — no iframe, no loaders. Attach, the wallet, and the pay sheet are native screens calling the API directly; the only webview inside is the hosted card capture and bank ceremony, which keeps your PCI scope at zero. Available to design partners as a Swift package.
reference is your own id for the payment (an order or checkout id). It is what keeps two different payments with the same amount separate: retries of one payment reuse its reference, distinct payments never share one. Events mirror the web SDK exactly: ready, stepChanged, cardAttached, paymentCompleted, tokenExpired.

React Native

@agentcard/wallet-react-native wraps the same sheet for React Native apps (requires react-native-webview). Same wallet link in, same events out; bank approvals open in the system browser.

Testing

Mint wallet links with your sandbox credentials and everything runs in test mode end to end: the sheet shows test cards, attach completes instantly, and pay-sheet mints skip the bank approval. See Testing for the sandbox setup.

Instructions for your agent

Paste this into your coding agent to implement the embed.
Instructions for your agent