Skip to main content
Let your agent pay with your users’ own cards while it shops in a Browser Use browser, whether your own agent does the shopping or Browser Use’s hosted agent does. The Agentcard SDK connects to the browser through Playwright over its cdpUrl, the same way it attaches to any CDP browser. Browser Use lets several connections share one browser, so the SDK and the agent work in the same browser at the same time. You need a user with a card in the Vault first. See Adding a card.

Install

Shop with your own agent

Create a Browser Use browser, connect Playwright to its cdpUrl, and attach Agentcard to the page before your agent reaches the payment form.
An agent built on Browser Use’s open-source Python library connects to the same browser. Give it the same cdpUrl, and keep the Node process above running while the agent shops:
The agent types the placeholder card, and the SDK pauses the payment until the user approves. With keep_alive=True, the browser stays open after the agent finishes, so you can still confirm the order with the merchant.

Shop with Browser Use’s agent

When Browser Use’s hosted agent does the shopping, attach Agentcard before the shopping task starts. A run starts working as soon as you create it, so open the session with a first run that only opens the store. Attach Agentcard to that run’s browser, wait until it is ready, then give the shopping task to a second run in the same session. Browser Use keeps a session on the same browser between runs.
Browser Use can move a session to a new browser, for example after the old one times out. The shopping run names its browser when it is dispatched, before the agent takes its first step, so the example cancels the run there instead of letting the agent pay in a browser Agentcard is not attached to. Put the placeholder card in the task, and tell the agent that the payment waits for the user after Pay. Send the approval link to the user over your own app or thread, and keep it out of the task and your logs: the link opens the approval screen for this payment, and only the user should see it.

Stop the browser

A Browser Use browser keeps running until it times out or you stop it, and a run’s browser stays open after the run finishes. Closing the Playwright connection does not stop it. Once you have confirmed the order with the merchant, stop the browser:

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.