🌟 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
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
maxDuration
and/or consider Edge runtime limits depending on plan.