Migrating away from Vercel? Run your cron jobs hassle-free.
To install the package, run:
npm install @launsh/nextjs-cron-runner
Using yarn? Cool!
yarn add @launsh/nextjs-cron-runner
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();
}
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
});
}