Skip to content

TestWebhooksOptions

Defined in: src/testing.ts:24

Options for createTestWebhooks.

Property Type Description Overrides Inherited from Defined in
allowInsecureUrls? boolean Allow http: endpoint URLs beyond localhost (dev only; default false). - WebhooksCoreOptions.allowInsecureUrls src/core.ts:201
dispatcher? DispatcherOptions Dispatcher config; a fast all-immediate retry schedule is the default. WebhooksCoreOptions.dispatcher - src/testing.ts:26
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. - WebhooksCoreOptions.hooks src/core.ts:177
now? () => number Injectable clock (unix millis) for tests. Default Date.now. - WebhooksCoreOptions.now src/core.ts:213
onDelivery? DeliveryListener Fire-and-forget sink invoked for every delivery attempt (metrics tap). - WebhooksCoreOptions.onDelivery src/core.ts:181
onDeliveryError? DeliveryErrorReporter Reporter invoked when the onDelivery sink throws/rejects. - WebhooksCoreOptions.onDeliveryError src/core.ts:183
onHookError? HookErrorReporter Reporter invoked when an after hook throws. Defaults to console.warn. - WebhooksCoreOptions.onHookError src/core.ts:179
payloadLimitBytes? number Max serialized payload size accepted by publish. Default 262_144 bytes. - WebhooksCoreOptions.payloadLimitBytes src/core.ts:205
readonly? boolean When true, all mutating operations throw ReadonlyError. - WebhooksCoreOptions.readonly 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). - WebhooksCoreOptions.requireKnownEventTypes 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. - WebhooksCoreOptions.retention src/core.ts:191
secretRotationGrace? WebhookDuration Grace window during which a rotated-out secret keeps signing. Default "24h". - WebhooksCoreOptions.secretRotationGrace src/core.ts:199
urlPolicy? (url) => boolean Extra endpoint-URL gate; return false to reject (SSRF denylist etc.). - WebhooksCoreOptions.urlPolicy src/core.ts:203