1
Create a sample project
- TypeScript
- Python
- Go
4.4.x minor version to match Stagehand’s supported types. Newer Zod minor versions can cause TypeScript errors when passing schemas to extract().2
Write the script
Create the example script (
index.ts, main.py, or main.go). It exercises all three primitives: act, extract, and observe.- TypeScript
- Python
- Go
Stagehand never reads environment variables on your behalf. Read your model provider API key in your own code and pass it to
Stagehand.create(), as the script above does. A local browser cannot use the Model Gateway, so Stagehand requires you to provide a model and its API key.3
Run it
Set your model provider API key, then run the script. Stagehand launches Chrome on your machine and opens a visible window, so you can watch each step as it happens.
- TypeScript
- Python
- Go
Next steps
Learn about the Stagehand primitives: act, extract, and observe.Act
Perform actions on web pages with natural language
Extract
Get structured data with typed schemas
Observe
Discover available elements and actions
Installation
Add Stagehand to an existing project

