@launsh/nextjs-cron-runner
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

@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-runner

Using yarn? Cool!

yarn add @launsh/nextjs-cron-runner

Usage

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
  });
}

/@launsh/nextjs-cron-runner/

    Package Sidebar

    Install

    npm i @launsh/nextjs-cron-runner

    Weekly Downloads

    6

    Version

    0.0.0

    License

    MIT

    Unpacked Size

    11.9 kB

    Total Files

    18

    Last publish

    Collaborators

    • kldzj