The Observability module records what happened in the store and delivers it to the outside world. It owns the audit log, the outbox events, webhook delivery, and order-confirmation email.
Features
- Audit log — a record of mutations with the actor and request context.
- Outbox events — commerce changes are written to an outbox and delivered asynchronously.
- Webhook endpoints — subscribe external systems to events, with secret rotation and delivery history.
- Signed deliveries — each webhook request carries an HMAC signature over the timestamp and body.
- Retries and deactivation — failed deliveries retry with backoff; a
410response deactivates the endpoint. - Order confirmation email — send the order confirmation through the outbox worker’s email configuration.
Key concepts
| Concept | What it means |
|---|---|
| Audit entry | A record of a mutation, who made it, and the request context. |
| Outbox event | A commerce event written transactionally with the change. |
| Webhook endpoint | A URL subscribed to one or more event names. |
| Delivery | One attempt to send an event to an endpoint. |
| Signature | x-edgecart-signature: t=...,v1=..., an HMAC over the timestamp and body. |
| Retry | A later delivery attempt after a failure. |
| Dead-letter queue | The queue that holds messages that exhausted retries. |
How it fits
- Orders, Payments, Order changes — write events such as order creation, payment capture, refunds, fulfillments, and confirmed order changes.
- Plugins — async plugin hooks (
order:created,order:paid,order:fulfilled,order:cancelled,refund:created) are delivered through the same outbox. - Outbox worker — a scheduled Worker consumes the queue, signs and sends webhooks, sends email, and records delivery attempts.
- Admin API — webhook endpoint management and delivery inspection are
available under
/api/webhook-endpointsand/api/webhook-deliveries.
Common tasks
- Merchant — order confirmation email is part of the checkout experience. Webhook subscriptions are typically set up by a developer or integration partner. See the merchant guide for order workflows.
- Developer — create an endpoint with
POST /api/webhook-endpoints, rotate its secret withPOST /api/webhook-endpoints/:id/rotate-secret, and inspect deliveries withGET /api/webhook-deliveries. Browse the operations in the API reference.
Delivery rules
- Subscribe to exact event names, or use
["*"]for all events. Wildcards such asorder.*are not supported. - Delivery is at least once. Deduplicate by event ID in your receiver.
- Retries use backoff. A
410response deactivates the endpoint. - Verify the signature over
timestamp + "." + bodybefore trusting a payload.
Current boundaries
- Webhook URL validation is lexical. A hostname that resolves to a private or loopback address, including DNS rebinding, cannot be detected inside the Workers runtime; only subscribe endpoints you control.
- The outbox queue is configured for local emulation. Remote deployment
requires creating
edgecart-outboxandedgecart-outbox-dlqand deploying the outbox worker separately. - Plugin action delivery is at least once; plugins must deduplicate by event ID.
- The outbox worker needs its own email configuration; the main app’s SMTP secrets are not shared automatically.
See current limitations for the full list.
Related modules
- Orders — order lifecycle events.
- Payments — payment and refund events.
- Order changes — returns and confirmed changes.