@launsh/nextjs-cron-runner
v0.0.0
Published
Migrating away from Vercel? Run your cron jobs hassle-free.
Readme
@launsh/nextjs-cron-runner
Migrating away from Vercel? Run your cron jobs hassle-free.
Installation
To install the package, run:
npm install @launsh/nextjs-cron-runnerUsing yarn? Cool!
yarn add @launsh/nextjs-cron-runnerUsage
Use @launsh/nextjs-cron-runner to run your cron jobs in your Next.js app.
// instrumentation.ts
import initCronRunner from "@launsh/nextjs-cron-runner";
export async function register() {
await initCronRunner();
}Configuration
You can configure the package by passing a Config object to the init function.
import initCronRunner from "@launsh/nextjs-cron-runner";
export async function register() {
await initCronRunner({
vercelFilePath: "apps/web/vercel.json", // defaults to "./vercel.json"
hostname: "https://my-app.com", // defaults to "http://localhost:3000"
cronSecret: "1234567890", // defaults to process.env.CRON_SECRET
});
}