Skip to content

WebhookHookOptions

Defined in: hooks/webhook.ts:31

Options for createWebhookHook.

Property Type Description Defined in
events? readonly ( | "flag.upserted" | "flag.archived" | "flag.restored" | "flag.deleted" | "segment.upserted" | "segment.deleted" | "published" | "rolledback" | "snapshot.deleted" | "audit.pruned")[] Restrict which after event types are delivered. Default: all of them. (e.g. ["published", "rolledback"] for publish/rollback notifications.) hooks/webhook.ts:40
fetch? typeof fetch Injectable fetch (for tests / custom transport). Default: global fetch. hooks/webhook.ts:52
headers? Record<string, string> Extra headers merged into every request. hooks/webhook.ts:42
maxAttempts? number Total delivery attempts before giving up. Default 3. hooks/webhook.ts:46
retryDelayMs? number Base backoff in ms; attempt n waits retryDelayMs * 2^(n-1). Default 200. hooks/webhook.ts:48
secret? string HMAC-SHA256 signing key. When set, each request carries a signature header. hooks/webhook.ts:35
signatureHeader? string Header carrying the sha256=<hex> signature. Default "x-flags-signature". hooks/webhook.ts:44
timeoutMs? number Per-attempt timeout in ms. Default 10_000. hooks/webhook.ts:50
url string Destination URL that receives POST requests with the event as JSON. hooks/webhook.ts:33