fetch does: Node 18+, browsers, Deno, Bun, and Cloudflare Workers.
Quickstart
Pagination
List methods return aPaginator you can iterate directly — it follows the cursor for you:
Errors
Every failure is aWebhookError subclass, so you can narrow by instanceof:
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, honouringRetry-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.