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
- Your server mints a wallet link for a connected user:
POST /api/v2/wallet_linkswith your client-credentials token. - Your page passes the link to
AgentCard.create()and callsopen(). - The user attaches a card or approves a payment inside the sheet.
- 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.
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: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 ononEvent(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