Vercel
Deploy with PostgreSQL and authenticated Vercel Cron routes.
A Vercel deployment pairs PostgreSQL with Vercel Cron. The overlay adds one
cron route per job, guarded by a bearer secret, and a vercel.json that
schedules all three.
Cron routes
The schedules must match checks.interval, checks.summaryCron and
checks.cleanupCron in the configuration file.
Without a secret the handler answers 503. That is intentional:
cleanup deletes history and checks sends outbound
requests to every configured monitor, so an unauthenticated trigger is both
destructive and abusable.
Vercel sends Authorization: Bearer $CRON_SECRET with scheduled invocations.
The comparison is constant-time.
Responses
| Task | Response |
|---|---|
checks | { "ok": true, "task": "checks", "results": 6 } |
summarize | { "ok": true, "task": "summarize", "result": { … } } |
cleanup | { "ok": true, "task": "cleanup" } |
Deploy
- 1
Provision PostgreSQL
Vercel Postgres, Neon, Supabase or any managed instance. Prefer a pooled connection string for serverless functions.
- 2
Set environment variables
Variable Purpose DATABASE_URLPostgreSQL connection string. CRON_SECRETBearer secret for the cron routes. HEYO_STATUS_API_TOKENBearer token for /admin/*.Set them for Production, Preview and Development as needed.
- 3
Migrate
bashRun it once per environment before the first deploy, and again after upgrading the package. Request handlers never migrate automatically.
- 4
Deploy and verify
bash
Notes for serverless
- The function filesystem is ephemeral and read-only, which is why SQLite is not offered for this target.
- The snapshot cache lives inside one instance. It still removes repeated reads within an invocation burst.
- Keep the connection pool small and pooled; a status page issues only a handful of queries per request.
- Cron frequency is bounded by your Vercel plan, regardless of what the configuration says.
tcpandsslmonitors work on Vercel's Node runtime — use Node.js 20.19+ sonode:netandnode:tlsresolve.
Other frameworks
The same overlay exists for each template:
| Framework | Cron route |
|---|---|
| Next.js | app/api/cron/[task]/route.ts |
| React Router | src/routes/api.cron.$task.ts |
| Astro | src/pages/api/cron/[task].ts |