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

# HTTP Plugin

> Document the HTTP emitter and its configuration surface.

The HTTP plugin POSTs plugin envelopes to an HTTP(S) endpoint. It is the most versatile transport because almost every platform speaks HTTP. Configuration is stored at the system data root (for example `~/.eventdbx/plugins.json`).

## Minimal config

```bash theme={null}
dbx plugin config http --name crm-webhook --endpoint https://api.example.com/eventdbx --payload event-only --header "Authorization=Bearer ${CRM_TOKEN}"
```

## Payload format

The plugin sends JSON with `event`, optional `state`, and optional `schema` keys based on payload mode:

```json theme={null}
{
  "event": { "aggregate_type": "person", "aggregate_id": "p-001", "event_type": "person_updated", "payload": {...}, "metadata": {...}, "extensions": {...} },
  "state": { "aggregate_type": "person", "aggregate_id": "p-001", "version": 5, "state": {...} },
  "schema": { "aggregate": "person", ... }
}
```

Choose what appears by setting `payload_mode` on the plugin definition.

## Authentication

* Static bearer tokens via `headers`.
* `https = true` prepends `https://` when `endpoint` is a bare host.

## Retries and DLQ

The queue retries automatically until `plugin_max_attempts` (configured via `dbx config`). Failures are logged; inspect and replay with `dbx queue`.

## Observability

Logs include status codes and truncated responses. Use `dbx plugin test <name>` to send a sample envelope and verify connectivity.
