🌟 Preview: Browser Functions - Deploy your web automation code directly on Browserbase with browser functions. Scale your
act() automations in the cloud with zero infrastructure setup. Reach out to hello@browserbase.com to get beta access.Deploy on Vercel
Securely run Stagehand on Browserbase inside a Vercel Function. This guide shows a minimal, production-safe HTTP endpoint you can call directly or on a schedule.1. Install Vercel CLI
To download and install Vercel CLI, run one of the following commands:2. Project layout
3. api/run.ts (Node.js runtime)
4. package.json
5. tsconfig.json
6. vercel.json
7. Link your project
Link your local folder to a Vercel project before configuring environment variables:8. Environment variables
Do not commit.env in production. Add variables via Vercel CLI:
9. Test locally
Replicate the Vercel environment locally to exercise your Function before deploying. Run from the project root.10. Deploy
Execute the function
Configure Protection Bypass for Automation
Before invoking the production URL, create a Protection Bypass for Automation:- Generate a 32-character secret (you can use
openssl rand -hex 16) - Go to your project in Vercel
- Navigate to Settings → Deployment Protection
- Add the secret to “Protection Bypass for Automation”
Optional: Cron on Vercel
Hit the same endpoint on a schedule by extendingvercel.json:
Features
- No local browsers needed with
env: "BROWSERBASE". Browserbase provides the browsers. - Fast functionality: Offload browser work to Browserbase and return JSON promptly.
- Long-running tasks: Raise
maxDurationand/or consider Edge runtime limits depending on plan.

