Skip to main content
The quickest way to start with Stagehand is with our CLI. It scaffolds a ready‑to‑run Stagehand app with sensible defaults, and an example script. You can also try Stagehand using our MCP server.
This quickstart is for TypeScript. For other languages, change the language selector in the top left corner.

1) Create a sample project

2) Run it

Follow the CLI prompts to enter the project directory and add your API keys. Then run the example script.

3) Use Stagehand (act, extract, observe)

The scaffold includes an index.ts file that contains the example script. Here’s what it looks like:
To use, set provider keys in .env (e.g., OPENAI_API_KEY). For cloud browsers, add BROWSERBASE_API_KEY.

Next steps

Learn about the Stagehand primitives: act, extract, observe, and agent.

Act

Perform actions on web pages with natural language

Extract

Get structured data with Zod schemas

Observe

Discover available elements and actions

Agent

Autonomous multi-step browser workflows