Loading...
Loading...
Vercel Cron Jobs configuration and best practices. Use when adding, editing, or debugging scheduled tasks in vercel.json.
npx skill4agent add vercel-labs/vercel-plugin cron-jobsvercel.jsoncronsvercel.json{
"crons": [
{
"path": "/api/cron/daily-digest",
"schedule": "0 8 * * *"
}
]
}path/api/cron/...minute hour day-of-month month day-of-weekAuthorizationCRON_SECRET// app/api/cron/route.ts
export async function GET(request: Request) {
const authHeader = request.headers.get("authorization");
if (authHeader !== `Bearer ${process.env.CRON_SECRET}`) {
return new Response("Unauthorized", { status: 401 });
}
// ... your scheduled logic
return Response.json({ ok: true });
}"0 8 * * *""0 * * * *""*/5 * * * *""0 9 * * 1-5"vercel logs --follow