Skip to content

WebhooksCoreOptions

Defined in: src/core.ts:162

Options for createWebhooksCore.

Property Type Description Defined in
allowInsecureUrls? boolean Allow http: endpoint URLs beyond localhost (dev only; default false). src/core.ts:201
dispatcher? DispatcherOptions Dispatcher configuration, carried here so panels/CLI construct dispatchers consistently. The core itself never starts one — creation is the panel/CLI’s job (or yours, via createDispatcher(core, core.options.dispatcher)). src/core.ts:197
hooks? WebhooksHooksInput Control-plane hooks fired around admin mutations. Pass one hook or an array. before hooks run sequentially and may throw to deny; after hooks run post-commit for side effects and never fail the operation. src/core.ts:177
now? () => number Injectable clock (unix millis) for tests. Default Date.now. src/core.ts:213
onDelivery? DeliveryListener Fire-and-forget sink invoked for every delivery attempt (metrics tap). src/core.ts:181
onDeliveryError? DeliveryErrorReporter Reporter invoked when the onDelivery sink throws/rejects. src/core.ts:183
onHookError? HookErrorReporter Reporter invoked when an after hook throws. Defaults to console.warn. src/core.ts:179
payloadLimitBytes? number Max serialized payload size accepted by publish. Default 262_144 bytes. src/core.ts:205
queueStorage? KvStorage Store for deliveries, attempts, and the due index. Defaults to storage. Splitting lets control data live in Postgres while the queue lives in Redis. src/core.ts:169
readonly? boolean When true, all mutating operations throw ReadonlyError. src/core.ts:171
requireKnownEventTypes? boolean Whether WebhooksCore.publish requires the event type to exist in the catalog. Default true — a typo’d event type name would otherwise silently deliver to nobody (endpoints subscribe by exact name). src/core.ts:211
retention? RetentionOptions Retention policy. Message pruning cascades deliveries/attempts and is non-vetoable; removed payloads are surfaced to after hooks (message.pruned, audit.pruned) so they can be offloaded first. Pruning runs opportunistically after publishes (off the hot path, fire-and-forget) and on demand via WebhooksCore.prune. src/core.ts:191
secretRotationGrace? WebhookDuration Grace window during which a rotated-out secret keeps signing. Default "24h". src/core.ts:199
storage KvStorage Control-plane store: applications, event types, endpoints, messages, audit. src/core.ts:164
urlPolicy? (url) => boolean Extra endpoint-URL gate; return false to reject (SSRF denylist etc.). src/core.ts:203