Skip to main content

Overview

Stagehand agents run on Browserbase cloud browsers. When your agent reaches a checkout, the @ovra/pay SDK fills the payment form — the agent never sees card data.

Setup

npm install @ovra/pay @browserbase/stagehand

Agent Flow

import { Stagehand } from "@browserbase/stagehand";
import * as OvraPay from "@ovra/pay";

OvraPay.configure({ apiKey: "sk_test_..." });

// 1. Agent browses autonomously
const stagehand = new Stagehand({ env: "BROWSERBASE" });
await stagehand.init();
await stagehand.act("go to amazon.de");
await stagehand.act("search for USB-C hub under 30 euros");
await stagehand.act("add the first result to cart");
await stagehand.act("proceed to checkout");

// 2. Ovra pays — one line, agent sees nothing
const result = await OvraPay.checkout(stagehand.page, {
  intentId: "in_xxx"  // pre-approved intent
});

// result.success === true
// result.profile === "Generic Card Form"
// Agent never saw PAN/CVV

// 3. Agent continues
await stagehand.act("confirm the order");

How It Works

  1. Stagehand navigates using natural language commands
  2. At checkout, you call OvraPay.checkout(stagehand.page, { intentId })
  3. The SDK runs inside page.evaluate() — an isolated execution context
  4. Card credentials exist only during the form fill, never in agent memory
  5. The agent gets back { success: true } and continues

With MCP

If your Stagehand agent uses MCP tools, add Ovra’s server:
{
  "mcpServers": {
    "ovra": {
      "type": "streamable-http",
      "url": "https://api.getovra.com/api/mcp",
      "headers": { "Authorization": "Bearer sk_test_..." }
    }
  }
}
The agent can then call ovra_checkout_pay with its Browserbase session’s CDP URL.