---
title: "Observability"
description: "Audit logs, outbox events, webhooks, and email delivery in EdgeCart."
---

> Documentation Index
> Fetch the complete documentation index at: https://edgecart.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Observability

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 `410`
  response 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-endpoints` and `/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](https://edgecart.dev/merchants/) for order workflows.
- **Developer** — create an endpoint with
  `POST /api/webhook-endpoints`, rotate its secret with
  `POST /api/webhook-endpoints/:id/rotate-secret`, and inspect deliveries with
  `GET /api/webhook-deliveries`. Browse the operations in the
  [API reference](https://edgecart.dev/api).

## Delivery rules

- Subscribe to exact event names, or use `["*"]` for all events. Wildcards such
  as `order.*` are not supported.
- Delivery is at least once. Deduplicate by event ID in your receiver.
- Retries use backoff. A `410` response deactivates the endpoint.
- Verify the signature over `timestamp + "." + body` before 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-outbox` and `edgecart-outbox-dlq` and 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](https://edgecart.dev/reference/limitations) for the full list.

## Related modules

- [Orders](https://edgecart.dev/modules/orders) — order lifecycle events.
- [Payments](https://edgecart.dev/modules/payments) — payment and refund events.
- [Order changes](https://edgecart.dev/modules/order-changes) — returns and confirmed changes.

Source: https://edgecart.dev/modules/observability/index.mdx
