Overview
@agentvault/playwright is a drop-in for Playwright’s chromium. Every browser
action runs in the Agent Vault proxy. Your agent fills forms with
mock tokens, and the proxy substitutes the real card
numbers, addresses and passwords inside its own browser.
The install URL
The package is not on npm. Agent Vault hosts it as a self-contained tarball:Self-hosting Agent Vault? Copy the whole block from the framework picker on your
dashboard’s Overview page instead: it fills in your deployment’s install URL,
proxy URL and API URL. Changing only the install URL sends your key to the hosted
proxy and API, which do not recognise it.
Install
1
Add the package
package.json. Run
the install again to upgrade.2
Set the environment variables
- Without the API key,
listTokens()andchromium.launch()throwno API key. - Without the proxy URL, the SDK targets a local proxy at
ws://localhost:4000/v1andchromium.launch()fails withFailed to connect to proxy. - Without the API URL,
listTokens()fails.
apiKey and proxyUrl to
chromium.launch(), and apiKey and baseUrl to listTokens(). See
Launching. The full list is on
Environment variables.3
Check the catalog
The snippet uses top-level This needs no browser. If it throws
await: save it as check.mjs, or set
"type": "module" in your package.json.invalid_api_key, check the key on the
dashboard’s API keys page.Run a checkout
The card order in step 6 matters. Filling the number authorizes the security
code that follows it exactly once, and any action in between asks the account
holder to approve the purchase a second time. See Card order.
Next steps
API reference
Exports, the browser object model and the catalog helpers.
Sessions and timeouts
Which errors end a session and which do not.
Error codes
What each refusal means and whether to retry.
First checkout
A guided checkout, end to end.