Stagehand is the SDK for browser agents.
Ready-to-use automation templates for Stagehand and Browserbase. Each template has its own README with setup instructions.
All templates also live on browserbase.com/templates
Stagehand primitives use the Browserbase Model Gateway, so they need only BROWSERBASE_API_KEY. Bring-your-own-agent templates also use Vercel AI Gateway for the outer agent loop and require AI_GATEWAY_API_KEY; no provider-specific OpenAI, Anthropic, or Google key is required.
Stagehand V4 note: V4 does not expose the V3
agent()orchestration API. TypeScript agent templates use Vercel AI SDK with Stagehand'scode_executetool. Python agent templates use LangChain Deep Agents with Stagehand'srun,snapshot, andscreenshottools. Other templates call V4 browser primitives directly.
- Choose a template from the table above
- Read the template's README for specific setup instructions
- Set up your environment with the required API keys and dependencies
- Run the template and start automating
Each template's README contains detailed installation steps, environment variable requirements, and troubleshooting guides.
- Source of truth: edit templates under
typescript/. Thejavascript/tree is generated output, not authored by hand for day-to-day changes. - Local only: run
pnpm run build:javascriptwhen you want a full mirror oftypescript/intojavascript/on your machine (for example to smoke-test the transpiler or compare JS output). There is no GitHub Actions workflow that builds the full tree into the repo anymore. - Playground releases: the
productionbranch is updated by CI (.github/workflows/playground-production.yml), which builds and commits only templates that are playground-runnable per the public templates API, then validates them.
- Stagehand Docs: https://docs.stagehand.dev/v4/first-steps/introduction
- Browserbase Docs: https://docs.browserbase.com
- Discord: http://stagehand.dev/discord
- Email Support: support@browserbase.com
- GitHub Issues: Report bugs and request features
We welcome contributions! Here's how you can help:
- Report Bugs: Use GitHub issues to report problems
- Suggest Features: Propose new templates or improvements
- Submit Pull Requests: Contribute code improvements
- Share Templates: Create and share your own templates
- Follow the established structure and naming conventions
- Include comprehensive README documentation
- Add proper error handling and logging
- Test templates thoroughly before submitting
This project is licensed under the MIT License - see the LICENSE file for details.
