Skip to main content
Install Stagehand in your current app with the TypeScript SDK.
We recommend using the Node.js runtime environment to run Stagehand scripts.Bun is now supported as long as you do not integrate Stagehand with Playwright. Playwright is not compatible with Bun.

Install dependencies

If you plan to run locally, you need to have Chrome installed on your machine. For cloud browser sessions, skip this.

Configure environment

Set environment variables (or a .env via your framework):
Stagehand does not auto-load .env files.If you use a .env file, install and initialize dotenv in your own app code:

Use in your codebase

Add Stagehand where you need browser automation.

Next steps

Configuration

Environment, Browserbase vs Local, logging, timeouts, LLM customization

Act

Perform precise actions with natural language

Extract

Typed data extraction with Zod schemas

Observe

Discover elements and suggested actions