Check out the Playbook

We’ve created a Github repository with plenty of ready-to-run guides for Stagehand, including persistent contexts and deploying to Vercel.

Persistent Contexts

npx create-browser-app --example persistent-contexts

This example uses Browserbase’s context persistence to create a persistent context that can be used across multiple runs.

This is really useful for automating on sites that require login, or for automating on sites that have a captcha. Once you’ve logged in, you can use the same context to automate on the same site without having to log in again.

Deploying to Vercel

npx create-browser-app --example deploy-vercel

This example creates a scaffolded Vercel function that can easily be deployed to Vercel with npx vercel deploy.

It creates a GET endpoint at /api/stagehand that can be used to run Stagehand script in index.ts.