s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All packages
Foundation v0.57.40 New

@happyvertical/smrt-webhooks

Outbound webhook subscriptions with HMAC-signed delivery to public HTTPS endpoints, a durable jobs queue, retries, and a safe delivery log.

Source ↗

What it gives you

Outbound webhook subscriptions with HMAC-signed delivery to public HTTPS endpoints, a durable jobs queue, retries, and a safe delivery log.

  1. 01WebhookChangeFeed reads the committed change feed, including delete tombstones, and advances a persisted cursor only after enqueue is durable
  2. 02A unique (tenant, subscription, event) outbox row and its job enqueue commit in one transaction; repeated dispatch is a no-op
  3. 03Only HTTPS port 443 to public unicast addresses, DNS pinned, no redirects, bounded deadlines

Two publication paths, never both

The durable path polls the change feed per tenant context and publishes identity-only payloads. registerWebhookModelEvents is a low-latency hook binding with an explicit model allowlist, but a crash between source commit and enqueue can miss an event. Do not enable both for the same models. A pruned cursor raises WebhookHistoryExpiredError and stops rather than dropping history.

At-least-once delivery

Five attempts use the jobs package’s exponential retry. A delivery lease prevents overlapping attempts; an expired lease permits recovery after worker death. Receivers must deduplicate the x-smrt-delivery header. The signature is sha256 HMAC over the timestamp and the exact persisted body.

Administration stays on the server

WebhookAdminService authorizes administrators through a host callback. The WebhookAdmin component takes subscriptions, deliveries, and onCreate, onToggle, onReplay callbacks; it never receives signing secrets. The integrations.webhooks recipe declares a server runtime and a settings panel, not model navigation.