콘텐츠로 이동

DeliveryTrackingServiceConfig

Defined in: packages/messaging/src/delivery-tracking/service.ts:201

optional apiFailover?: DeliveryTrackingApiFailoverConfig

Defined in: packages/messaging/src/delivery-tracking/service.ts:205


optional onStatusChange?: (change) => void | Promise<void>

Defined in: packages/messaging/src/delivery-tracking/service.ts:220

Called for each record a poll stored with a different status, with the record as stored, after the poll finishes: for example, to notify a webhook when a message is delivered or fails. Calls run one at a time, in the order changes were stored, each with its own copy of the record; runOnce() describes the one exception, in runtimes without AsyncLocalStorage. It does not stop polling if it throws.

Delivery is best effort: a change whose callback throws is not retried, and one stored just before the process stops is not reported, so reconcile with the stored records when none may be missed. Services polling the same store can also each report the same change, so make it idempotent, for example by message id and status.

DeliveryStatusChange

void | Promise<void>


optional onStatusChangeError?: (error, change) => void | Promise<void>

Defined in: packages/messaging/src/delivery-tracking/service.ts:225

Receives what onStatusChange throws. Without it, or when it throws too, the error is written to console.error.

unknown

DeliveryStatusChange

void | Promise<void>


optional polling?: Partial<DeliveryTrackingPollingConfig>

Defined in: packages/messaging/src/delivery-tracking/service.ts:204


providers: Provider[]

Defined in: packages/messaging/src/delivery-tracking/service.ts:202


optional store?: DeliveryTrackingStore

Defined in: packages/messaging/src/delivery-tracking/service.ts:203