Skip to main content
The TypeScript SDK is typed from the OpenAPI contract and ships both ESM and CommonJS. It runs anywhere fetch does: Node 18+, browsers, Deno, Bun, and Cloudflare Workers.

Quickstart

Pagination

List methods return a Paginator you can iterate directly — it follows the cursor for you:

Errors

Every failure is a WebhookError subclass, so you can narrow by instanceof:
Each error carries code, status, and requestId when present.

Retries & idempotency

The client retries idempotent requests on transient failures (429/502/503/504 and network errors) with capped exponential backoff and jitter, honouring Retry-After. It never blind-retries a non-idempotent write. Replays carry an idempotency key, so those are safe to retry:

Recovering a lost ingest URL

The ingest URL is a bearer credential, but it is not a one-time secret: the token is sealed at rest, so you can read it back any time. You never have to rotate to recover it — and you shouldn’t, because rotating revokes the live URL and breaks every sender still posting to it.
ingestUrl is null only for endpoints created before sealed storage; rotate those once to mint a fresh, re-readable one.

Triggers (webhook → agent)

Wait for an endpoint’s events with an ack-by-cursor loop. wait is a short poll — it returns immediately with whatever is past your cursor, so there is no held connection.
nextCursor is null only when you sent no cursor and there were no events — it means “start from the oldest retained event”, not “caught up”. caughtUp is the caught-up signal. Delivery is at-least-once: a crash before you persist the cursor re-reads rather than loses, so dedupe on the event id.

Usage, deletes, and dedup config

Version advisories

If the server sees you are on an old SDK, it rides an advisory back on a response you already made — the SDK never polls npm on your behalf, so there is no extra request and nothing to break offline. By default it prints one line to stderr. Route it into your own logs instead:

Configuration

Full source, changelog, and issues: github.com/webhook-co/webhook.