Skip to content

nikoewe/vercel-cronjob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vercel-cronjob

Standalone cron job runner that reads vercel.json and replicates Vercel's cron behavior — scheduled HTTP GET requests with the same headers Vercel sends.

Useful for running Vercel cron jobs in environments where Vercel isn't handling scheduling (e.g., Kubernetes production deployments).

Install

npm install vercel-cronjob

Usage

import { runCrons } from "vercel-cronjob";

runCrons({ url: "http://localhost:3000" });

With all options:

runCrons({
  url: "http://localhost:3000",
  cronSecret: "my-secret",         // optional — sent as Authorization: Bearer <secret>
  vercelJsonPath: "./vercel.json",  // optional — defaults to ./vercel.json
});

CLI

The package also ships a CLI that reads configuration from environment variables:

Variable Required Description
BASE_URL Yes Target app URL
CRON_SECRET No Sent as Authorization: Bearer <secret>
VERCEL_JSON_PATH No Path to vercel.json (default: ./vercel.json)
BASE_URL=http://localhost:3000 npx vercel-cronjob

License

MIT

About

Standalone Vercel cron job runner — replicates Vercel's cron behavior for non-Vercel deployments

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors