npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@webhookscheduler/sdk

v0.1.0

Published

Thin TypeScript client for Webhook Scheduler: schedule, inspect, and cancel future HTTP deliveries, and verify signed webhooks.

Readme

@webhookscheduler/sdk

Thin TypeScript client for Webhook Scheduler: schedule an HTTP request for any future time, watch it deliver with retries and logs, and cancel it before it fires.

  • Zero dependencies. Designed for server-side Node.js 18+ runtimes.
  • Fully typed: schedule, get, list, cancel, verifySignature.
  • The API it wraps is documented and OpenAPI-specced.

Install

npm install @webhookscheduler/sdk

Quickstart

import { WebhookScheduler } from '@webhookscheduler/sdk';

const whs = new WebhookScheduler({ apiKey: process.env.WEBHOOK_SCHEDULER_API_KEY! });

// Schedule a delivery for tomorrow 09:00 UTC
const job = await whs.schedule({
  url: 'https://api.example.com/webhooks/reminder',
  runAt: new Date(Date.now() + 24 * 60 * 60 * 1000),
  body: { userId: 'usr_4821', kind: 'trial_reminder' },
  idempotencyKey: 'trial-reminder-usr_4821',
});

// Inspect it (status, attempts, response codes, latency)
const detail = await whs.get(job.id);

// Cancel it if the user acts first
await whs.cancel(job.id);

// List what's pending
const pending = await whs.list({ status: 'PENDING' });

Get an API key from the dashboard. The free plan needs no credit card.

Next.js example: trial reminder you can cancel

Schedule a reminder when a trial starts, cancel it when the user upgrades. One POST each way, no cron, no queue, no worker.

// app/api/trials/route.ts
import { WebhookScheduler } from '@webhookscheduler/sdk';
import { NextResponse } from 'next/server';

const whs = new WebhookScheduler({ apiKey: process.env.WEBHOOK_SCHEDULER_API_KEY! });

export async function POST(request: Request) {
  const { userId, trialEndsAt } = await request.json();

  // Fire 3 days before the trial ends
  const remindAt = new Date(new Date(trialEndsAt).getTime() - 3 * 24 * 60 * 60 * 1000);

  const job = await whs.schedule({
    url: `${process.env.APP_URL}/api/hooks/trial-reminder`,
    runAt: remindAt,
    body: { userId },
    idempotencyKey: `trial-reminder-${userId}`, // safe to call twice
  });

  // Persist job.id next to the user so you can cancel on upgrade
  return NextResponse.json({ reminderJobId: job.id });
}
// When the user upgrades before the reminder fires:
await whs.cancel(user.reminderJobId);

Verifying deliveries

Every delivery is signed with a Webhook-Signature header (t=<unix>,v1=<hmac-sha256>) using your workspace secret from Settings. Verify against the raw body:

// app/api/hooks/trial-reminder/route.ts
import { verifySignature } from '@webhookscheduler/sdk';
import { NextResponse } from 'next/server';

export async function POST(request: Request) {
  const rawBody = await request.text();

  const valid = verifySignature({
    payload: rawBody,
    signature: request.headers.get('webhook-signature') ?? '',
    secret: process.env.WEBHOOK_SCHEDULER_SECRET!,
    toleranceSeconds: 300, // reject signatures older than 5 minutes
  });

  if (!valid) {
    return NextResponse.json({ error: 'Invalid signature' }, { status: 401 });
  }

  const { userId } = JSON.parse(rawBody);
  // ... send the reminder email
  return NextResponse.json({ ok: true });
}

verifySignature uses a timing-safe comparison and never throws on malformed input. It just returns false.

API

| Method | Endpoint | Returns | | --- | --- | --- | | schedule(params) | POST /api/v1/schedule | ScheduledJob | | get(jobId) | GET /api/v1/jobs/{id} | JobDetail (with attempts) | | list(params?) | GET /api/v1/jobs | JobList (paginated) | | cancel(jobId) | POST /api/v1/jobs/{id}/cancel | CanceledJob | | verifySignature(params) | local helper | boolean |

Errors throw WebhookSchedulerError with status, code (e.g. QUOTA_EXCEEDED, UNSAFE_TARGET_URL), and details.

Notes

  • Targets must be public HTTPS endpoints; localhost and private networks are rejected (security model).
  • Retries use exponential backoff; every attempt is visible in the dashboard and via get().
  • Try the API without an account at webhookscheduler.com/try.
  • Keep this SDK server-side. It uses your secret API key and imports Node crypto for signature verification.

License

MIT