- TypeScript
- Python
Before you begin, you’ll need to install Node.js and NPM. We highly recommend using nvm to manage your Node.js versions, and running on Node version 20+.Use the package manager of your choice to install the dependencies. We also have a
1
Create a new project
You can use npx to create a new project. You should have npx included with To use our Contexts with Stagehand, run:You can easily deploy Stagehand scripts to Vercel in one line! Simply run:We also have an example using CUA agents, where we put OpenAI Operator against Anthropic’s Claude Computer Use in a heated game of chess. It’s just ten lines of Stagehand code, try it with:You can also use the version of Stagehand that’s on main but not released yet. This will have the bleeding edge features, but they may not be fully prod-ready yet. To test this version, try:It will ask you the following questions:
npm, the default package manager for Node.js.- npm
- pnpm
- yarn
- npm
- pnpm
- yarn
- npm
- pnpm
- yarn
- npm
- pnpm
- yarn
- npm
- pnpm
- yarn
2
Install dependencies and run the script
- npm
- pnpm
- yarn
postinstall script that will automatically install the Playwright browser with playwright install.Adding Stagehand to an existing project:
1
Install Stagehand
2
Set up environment variables
Create a
.env file or export environment variables:3
Create your first script
Create a file
index.ts:4
Run the script
Check out the TypeScript repo
If you’re a TypeScript developer, you can check out the Stagehand TypeScript repo. PRs welcome!
Check out the Python repo
Stagehand now supports Python! The Python repo is brand new, so PRs are more than welcome!

