>_better-webhook
SDK

Adapter Options

Shared adapter options for secrets, limits, and success callbacks.

Adapter Options

All adapters support the same core options.

OptionTypeDescription
secretstringSecret used for signature verification. Overrides provider/env defaults.
maxBodyBytesnumberOptional body-size guard. Returns 413 when exceeded.
onSuccess(eventType: string) => void | Promise<void>Called after a successful 200 acknowledgement with body.ok === true (including ignored duplicates, excluding verified-but-unhandled 200 acknowledgements such as Resend).

Secret resolution order

When verifying signatures, secret lookup order is:

  1. Adapter options
  2. Provider options
  3. Environment variables (<PROVIDER>_WEBHOOK_SECRET, then WEBHOOK_SECRET as a fallback; for example GITHUB_WEBHOOK_SECRET or RESEND_WEBHOOK_SECRET)

Keep framework and edge/proxy body limits configured in addition to maxBodyBytes.

Canonical reference: Adapters

On this page