Skip to main content
Browserbase runs the browser your agent shops in. The Agentcard SDK attaches to it through Playwright over the session’s connectUrl, the same way it attaches to any CDP browser. You need a user with a card in the Vault first. See Adding a card.

Install

Connect and attach

Attach before the agent reaches the payment form. Browserbase’s default context lets a store start a service worker, and the SDK cannot pause a card request a service worker sends. The init script blocks service workers on that default context, so you keep the session recording without creating a new context. Block service workers explains what changes for the store. A store that already runs a service worker when you attach makes attachToPlaywright throw:
Add the init script before the session’s first navigation. If you load a saved Browserbase context and attach still throws, the context carries a service worker from an earlier session. Create checkout sessions without that saved context, or attach through CDP with serviceWorkers: 'bypass', as Your own browser shows. After the run, the session recording is at https://browserbase.com/sessions/${session.id}, which is useful for reviewing a checkout that needed a human.

Next

The rest of the flow is identical to any Vault purchase: placeholder card, passkey approval, real card swapped in, confirm with the merchant. Follow the Vault Quickstart from step 4, or read Completing a purchase.