1
Create a sample project
- TypeScript
- Python
- Go
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 the Browserbase API key in your own code and pass it to the browser factory, as the script above does. With no model configured, Browserbase selects one automatically for each inference call.
3
Run it
Set your Browserbase API key, then run the script. Model Gateway selects and authenticates the model automatically, so no model provider key is required.
- 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

