WebhooksCore
Defined in: src/core.ts:296
The admin + publish core surface.
Properties
Section titled “Properties”| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
options |
readonly |
object |
- | src/core.ts:297 |
options.allowInsecureUrls |
public |
boolean |
- | src/core.ts:306 |
options.dispatcher? |
public |
DispatcherOptions |
- | src/core.ts:304 |
options.hooks |
public |
WebhooksHooks[] |
Normalized hooks (always an array). | src/core.ts:302 |
options.now |
public |
() => number |
- | src/core.ts:312 |
options.onDelivery? |
public |
DeliveryListener |
- | src/core.ts:310 |
options.onDeliveryError? |
public |
DeliveryErrorReporter |
- | src/core.ts:311 |
options.payloadLimitBytes |
public |
number |
- | src/core.ts:308 |
options.queueStorage |
public |
KvStorage |
- | src/core.ts:299 |
options.readonly |
public |
boolean |
- | src/core.ts:300 |
options.requireKnownEventTypes |
public |
boolean |
- | src/core.ts:309 |
options.retention? |
public |
RetentionOptions |
- | src/core.ts:303 |
options.secretRotationGrace |
public |
WebhookDuration |
- | src/core.ts:305 |
options.storage |
public |
KvStorage |
- | src/core.ts:298 |
options.urlPolicy? |
public |
(url) => boolean |
- | src/core.ts:307 |
Methods
Section titled “Methods”claimDueDeliveries()
Section titled “claimDueDeliveries()”claimDueDeliveries(input): Promise<Delivery[]>;Defined in: src/core.ts:459
Claim up to limit due deliveries for exclusive processing. Uses the
storage’s native claimDue when available; otherwise scans the due index
with compare-and-swap claiming (plain read-modify-write when the storage
has no CAS — single-dispatcher assumption, see docs/DELIVERY.md).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
ClaimInput |
Returns
Section titled “Returns”Promise<Delivery[]>
createApplication()
Section titled “createApplication()”createApplication(input, options?): Promise<Application>;Defined in: src/core.ts:317
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ key: string; metadata?: JsonValue; name?: string; } |
input.key |
string |
input.metadata? |
JsonValue |
input.name? |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<Application>
createEndpoint()
Section titled “createEndpoint()”createEndpoint( applicationKey, input, options?): Promise<Endpoint>;Defined in: src/core.ts:344
Creates the endpoint and generates its first signing secret.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
input |
{ description?: string; disabled?: boolean; eventTypes?: string[]; headers?: Record<string, string>; metadata?: JsonValue; url: string; } |
input.description? |
string |
input.disabled? |
boolean |
input.eventTypes? |
string[] |
input.headers? |
Record<string, string> |
input.metadata? |
JsonValue |
input.url |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<Endpoint>
deleteApplication()
Section titled “deleteApplication()”deleteApplication(applicationKey, options?): Promise<void>;Defined in: src/core.ts:328
Deletes the application and everything under it (endpoints, messages, deliveries).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<void>
deleteEndpoint()
Section titled “deleteEndpoint()”deleteEndpoint( applicationKey, endpointId, options?): Promise<void>;Defined in: src/core.ts:368
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<void>
deleteEventType()
Section titled “deleteEventType()”deleteEventType(name, options?): Promise<void>;Defined in: src/core.ts:338
Delete an event type. Endpoints referencing it keep their subscription entry and simply stop matching new publishes of that name.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<void>
disableEndpoint()
Section titled “disableEndpoint()”disableEndpoint( applicationKey, endpointId, options?): Promise<Endpoint>;Defined in: src/core.ts:385
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<Endpoint>
enableEndpoint()
Section titled “enableEndpoint()”enableEndpoint( applicationKey, endpointId, options?): Promise<Endpoint>;Defined in: src/core.ts:380
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<Endpoint>
getApplication()
Section titled “getApplication()”getApplication(applicationKey): Promise< | Application| null>;Defined in: src/core.ts:321
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
Returns
Section titled “Returns”Promise<
| Application
| null>
getDelivery()
Section titled “getDelivery()”getDelivery(applicationKey, deliveryId): Promise< | { attempts: DeliveryAttempt[]; delivery: Delivery;}| null>;Defined in: src/core.ts:406
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
deliveryId |
string |
Returns
Section titled “Returns”Promise<
| {
attempts: DeliveryAttempt[];
delivery: Delivery;
}
| null>
getEndpoint()
Section titled “getEndpoint()”getEndpoint(applicationKey, endpointId): Promise<Endpoint | null>;Defined in: src/core.ts:342
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
Returns
Section titled “Returns”Promise<Endpoint | null>
getEventType()
Section titled “getEventType()”getEventType(name): Promise< | EventType| null>;Defined in: src/core.ts:332
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
Returns
Section titled “Returns”Promise<
| EventType
| null>
getMessage()
Section titled “getMessage()”getMessage(applicationKey, messageId): Promise<Message | null>;Defined in: src/core.ts:404
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
messageId |
string |
Returns
Section titled “Returns”Promise<Message | null>
getSecrets()
Section titled “getSecrets()”getSecrets(applicationKey, endpointId): Promise<EndpointSecret[]>;Defined in: src/core.ts:379
The endpoint’s secrets (current first). Gate behind endpoint:read-secret.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
Returns
Section titled “Returns”Promise<EndpointSecret[]>
listApplications()
Section titled “listApplications()”listApplications(): Promise<Application[]>;Defined in: src/core.ts:316
Returns
Section titled “Returns”Promise<Application[]>
listAudit()
Section titled “listAudit()”listAudit(applicationKey?): Promise<AuditEntry[]>;Defined in: src/core.ts:446
Newest-first. With applicationKey: that app’s log; without: global + all apps.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey? |
string |
Returns
Section titled “Returns”Promise<AuditEntry[]>
listDeliveries()
Section titled “listDeliveries()”listDeliveries(applicationKey, options?): Promise<Delivery[]>;Defined in: src/core.ts:405
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
options? |
ListDeliveriesOptions |
Returns
Section titled “Returns”Promise<Delivery[]>
listEndpoints()
Section titled “listEndpoints()”listEndpoints(applicationKey): Promise<Endpoint[]>;Defined in: src/core.ts:341
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
Returns
Section titled “Returns”Promise<Endpoint[]>
listEventTypes()
Section titled “listEventTypes()”listEventTypes(): Promise<EventType[]>;Defined in: src/core.ts:331
Returns
Section titled “Returns”Promise<EventType[]>
listMessages()
Section titled “listMessages()”listMessages(applicationKey, options?): Promise<Message[]>;Defined in: src/core.ts:403
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
options? |
ListMessagesOptions |
Returns
Section titled “Returns”Promise<Message[]>
noteEndpointOutcome()
Section titled “noteEndpointOutcome()”noteEndpointOutcome( applicationKey, endpointId, ok, policy?): Promise<Endpoint | null>;Defined in: src/core.ts:467
Update the endpoint’s failure streak after an attempt (any success clears
it) and auto-disable once the streak exceeds failingForDays. Returns the
endpoint when it was auto-disabled by this call.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
ok |
boolean |
policy? |
| false | { failingForDays?: number; } |
Returns
Section titled “Returns”Promise<Endpoint | null>
previewDeliveryRequest()
Section titled “previewDeliveryRequest()”previewDeliveryRequest(applicationKey, deliveryId): Promise< | SignedRequest| null>;Defined in: src/core.ts:418
The exact signed HTTP request this delivery would send right now —
method, URL, all headers (including the computed webhook-signature), and
body. The inspector view: shows what a receiver gets, without sending.
Returns null if the delivery or its endpoint no longer exists. The
webhook-timestamp/signature reflect the current time (they change per
attempt by design); the id and body are stable.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
deliveryId |
string |
Returns
Section titled “Returns”Promise<
| SignedRequest
| null>
prune()
Section titled “prune()”prune(): Promise<void>;Defined in: src/core.ts:450
Run retention now (also runs opportunistically after publishes).
Returns
Section titled “Returns”Promise<void>
publish()
Section titled “publish()”publish( applicationKey, input, options?): Promise<PublishResult>;Defined in: src/core.ts:396
Persist a message and fan out one pending delivery per matching enabled endpoint. Never performs HTTP; never throws because an endpoint is down.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
input |
PublishInput |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<PublishResult>
recordAttempt()
Section titled “recordAttempt()”recordAttempt(input): Promise<Delivery>;Defined in: src/core.ts:461
Record one attempt’s outcome and advance the delivery’s state machine.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
RecordAttemptInput |
Returns
Section titled “Returns”Promise<Delivery>
recoverEndpoint()
Section titled “recoverEndpoint()”recoverEndpoint( applicationKey, endpointId, input, options?): Promise<RecoverResult>;Defined in: src/core.ts:426
Re-queue every failed delivery for an endpoint created at/after since.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
input |
{ since: string; } |
input.since |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<RecoverResult>
retryDelivery()
Section titled “retryDelivery()”retryDelivery( applicationKey, deliveryId, options?): Promise<Delivery>;Defined in: src/core.ts:420
Re-queue a dead-lettered delivery (failed → pending, due immediately).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
deliveryId |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<Delivery>
rotateSecret()
Section titled “rotateSecret()”rotateSecret( applicationKey, endpointId, options?): Promise<Endpoint>;Defined in: src/core.ts:373
Mint a new current secret; the previous one keeps verifying until
secretRotationGrace elapses. Expired grace secrets are pruned lazily.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<Endpoint>
sendExample()
Section titled “sendExample()”sendExample( applicationKey, endpointId, input, options?): Promise<SendExampleResult>;Defined in: src/core.ts:437
Fire a one-off signed test delivery at an endpoint, synchronously, through
the same wire path as real deliveries (trigger: "test"). The synthetic
message is not retained.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
input |
{ eventType: string; payload?: JsonValue; } |
input.eventType |
string |
input.payload? |
JsonValue |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<SendExampleResult>
updateApplication()
Section titled “updateApplication()”updateApplication( applicationKey, patch, options?): Promise<Application>;Defined in: src/core.ts:322
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
patch |
{ metadata?: JsonValue; name?: string; } |
patch.metadata? |
JsonValue |
patch.name? |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<Application>
updateEndpoint()
Section titled “updateEndpoint()”updateEndpoint( applicationKey, endpointId, patch, options?): Promise<Endpoint>;Defined in: src/core.ts:356
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
applicationKey |
string |
endpointId |
string |
patch |
{ description?: string; eventTypes?: string[]; headers?: Record<string, string>; metadata?: JsonValue; url?: string; } |
patch.description? |
string |
patch.eventTypes? |
string[] |
patch.headers? |
Record<string, string> |
patch.metadata? |
JsonValue |
patch.url? |
string |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<Endpoint>
upsertEventType()
Section titled “upsertEventType()”upsertEventType(input, options?): Promise<EventType>;Defined in: src/core.ts:333
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
EventType |
options? |
ActorOptions |
Returns
Section titled “Returns”Promise<EventType>