Skip to content

Stagehand TypeScript Starter

Fresh

Source: GitHub | Language: TypeScript

Natural language browser automation powered by Stagehand + Steel.

Setup

bash
steel forge stagehand --name my-stagehand
# Or: npm install steel-sdk @browserbasehq/stagehand

Example

typescript
import Steel from "steel-sdk";
import { Stagehand } from "@browserbasehq/stagehand";

const steel = new Steel({ steelAPIKey: process.env.STEEL_API_KEY });
const session = await steel.sessions.create();

const stagehand = new Stagehand({
  env: "REMOTE",
  apiKey: process.env.OPENAI_API_KEY,
  cdpUrl: `wss://connect.steel.dev?apiKey=${process.env.STEEL_API_KEY}&sessionId=${session.id}`,
});

await stagehand.init();
await stagehand.page.goto("https://example.com");
await stagehand.act("Click on the login button");
await stagehand.act("Type 'hello' into the search box");

await steel.sessions.release(session.id);

See Also

SOP Documentation Hub - Built from Steel.dev Official Docs