Skip to content

@xtandard/audit/sinks/webhook

Standard Webhooks sink: webhookSink() POSTs signed batches (or items), verifiable by @xtandard/webhooks/receiver, Svix and the official standardwebhooks libraries. Zero dependencies.

import { … } from "@xtandard/audit/sinks/webhook";
Name Summary
batchWebhookId The webhook-id of a batch: the item’s own id when there is exactly one, otherwise bat_ + a SHA-256 prefix over the stream, tenant and item ids — stable across re-sends of the same batch.
signWebhook Sign one message: v1, + base64(HMAC-SHA256(key, ${id}.${timestamp}.${body})). timestamp is unix seconds.
webhookSink Create a Standard Webhooks-signed sink.
Name Summary
WebhookSinkOptions Options for webhookSink.
Name Summary
WEBHOOK_SECRET_PREFIX Prefix of a Standard Webhooks symmetric secret.
Name Documented on
SinkFetch @xtandard/audit/sinks/datadog
SinkHeaders @xtandard/audit/sinks/datadog
SinkHttpError @xtandard/audit/sinks/datadog