Skip to main content

Install

Install the Cuey client:
npm install cuey

Configure Your Environment Variables

  • Set CUEY_API_KEY with your API key from the dashboard (required)
  • Set CUEY_BASE_URL to use relative webhook URLs (optional)

Schedule Your First Webhook

import { cuey } from "cuey";

// Schedule a one-time webhook
const event = await cuey.schedule({
  webhook_url: "/webhook",
  scheduled_at: "2024-12-31T23:59:59Z",
  payload: {
    message: "Happy New Year from Cuey!",
  },
});

console.log("Event scheduled:", event.id);
The cuey instance automatically reads the CUEY_API_KEY environment variable for authentication and CUEY_BASE_URL for resolving relative webhook URLs.

Create a Recurring Webhook

import { cuey } from "cuey";

const cron = await cuey.repeat({
  webhook_url: "https://api.example.com/daily-report",
  cron_expression: "0 9 * * *", // Daily at 9 AM
  timezone: "America/New_York",
  payload: {
    report_type: "daily",
  },
});