Quickstart
Pagination
List methods return an*Iterator[T] (a Scanner-style iterator):
Errors
Every API failure is a*webhook.Error — use errors.As or the Is* helpers:
*Error carries Code, Status, RequestID, and RetryAfter. A transport failure is a *webhook.ConnectionError.
Retries & idempotency
The client retries idempotent requests on transient failures with capped exponential backoff and jitter, honouringRetry-After, and never blind-retries a non-idempotent write. Replays carry an idempotency key (auto-generated if you pass ""):
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 nil 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 nil 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 the module proxy 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
context.Context for cancellation and deadlines.
Full source, changelog, and issues: github.com/webhook-co/webhook-go.