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.
TypeScript
Other Languages
Install dependencies If you plan to run locally, you need to have Chrome installed on your machine. For cloud browser sessions, skip this. 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. For Python and other language SDKs, use the language selector in the top left corner of the sidebar to view the SDK documentation for your language.
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