Skip to main content

Get your API key

To authenticate with the Rapidcron API, you need an API key. You can view and manage your API keys here.

Install the SDK

  • npm
  • yarn
  • pnpm
  • bun
npm install rapidcron --save

Create a job

Start by creating a new instance of the SDK with your API key:
import Rapidcron from "rapidcron";

const rapidcron = new Rapidcron("API_KEY");
And then define a task depending on whether it’s a delayed or recurring task:
  • Delayed (One-off)
  • Recurring
await rapidcron.tasks.create({
    type: "delayed",
    nextRunAt: new Date(Date.now() + 1000 * 60 * 60), // 1 hour from now
    request: {
        method: "POST",
        url: "https://example.com",
        headers: {
            "Content-Type": "application/json"
        },
        body: JSON.stringify({
            hello: "world"
        })
    }
});