previewcron
v0.3.1
Published
Trigger & test your Vercel cron jobs locally or on preview deployments
Maintainers
Readme
previewcron
Trigger & test your Vercel cron jobs from a simple dashboard. Vercel only runs cron jobs in production — this tool lets you test them anywhere.
Usage
Run it in your project — no install, no setup, no files to add:
npx previewcronIt reads your cron jobs, opens a dashboard in your browser, and lets you
trigger each one against your local dev server (default
http://localhost:3000). Works with any framework — Next.js, SvelteKit,
Astro, Remix, Nuxt…
Cron jobs are read the way Vercel resolves its config:
vercel.json, or else.vercel/vercel.json— whatvercel.ts/vercel.tomlcompile to after anyvercel dev,vercel buildorvercel deploy- If that config has no
cronskey:.vercel/output/config.json— crons generated by your framework, aftervercel build
Each run sends the same request Vercel's scheduler sends in production: a
GET with user-agent: vercel-cron/1.0 and x-vercel-cron-schedule.
Redirects are not followed — a 3xx is the final answer, as on Vercel.
Secrets are picked up automatically from your environment, .env.local, or
.env:
CRON_SECRET→ pre-fills theAuthorization: Bearer …header (the same header Vercel sends in production)VERCEL_AUTOMATION_BYPASS_SECRET→ pre-fills thex-vercel-protection-bypassheader
Because the dashboard runs locally, it can hit localhost directly — no CORS,
no SSRF restrictions.
Options
npx previewcron [options]
-p, --port <number> Port for the dashboard (default: 4747)
-b, --base-url <url> Target app base URL (default: http://localhost:3000)
--vercel-json <p> Config file with "crons" (default: ./vercel.json, then .vercel/)
--no-open Do not open the browser automatically
-v, --version Print version
-h, --help Show this helpYour dev server runs on another port:
npx previewcron --base-url http://localhost:4000Target a preview deployment (the dashboard proxies requests locally, so any URL works — use the bypass token field if the preview has Deployment Protection):
npx previewcron --base-url https://my-app-abc123-team.vercel.appTesting preview deployments without the CLI
Prefer a hosted UI? Use previewcron.dev — paste
your vercel.json, enter the preview URL, and trigger your crons from the
browser.
Security
- The dashboard binds to
127.0.0.1only — it is never reachable from your network — and rejects requests from any other origin, so a website you visit cannot read your secrets or trigger your crons. - It only triggers the cron jobs from your config, never arbitrary URLs.
- Secrets are only sent to the target you choose; nothing leaves your machine otherwise.
License
MIT — Ludovic Gueth
