You can use npx create-browser-app to get started in 1 minute. This will create a new project that will analyze the Stagehand docs using Stagehand.

We highly recommend using the Node.js runtime environment to run Stagehand scripts, as opposed to newer alternatives like Deno or Bun.

Bun does not support Stagehand since it doesn’t support Playwright.

1

Prerequisites

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+.

2

Create a new project

You can use npx to create a new project. You should have npx included with npm, the default package manager for Node.js.

npx create-browser-app

To use the pre-release version of Stagehand, run:

npx create-browser-app --alpha

It will ask you the following questions:

✔ What is the name of your project? my-app
✔ Would you like to start with a quickstart example? Yes
✔ Select AI model: Anthropic Claude 3.7 Sonnet
✔ Run locally or on Browserbase? Local
✔ Run browser in headless mode (hide Chromium popup)?  No
3

Install dependencies and run the script

cd my-app
npm install
npm run start

Use the package manager of your choice to install the dependencies. We also have a postinstall script that will automatically install the Playwright browser with playwright install.

Next Steps