# Event Webhooks

Developer-preview NVR plugin sidecar. It polls `nvrd` motion/smart events and
forwards each event edge to a user-owned webhook.

This is the first real plugin used to exercise the marketplace, permissions, and
sidecar packaging path. The daemon does not supervise sidecars yet, so run it
manually while the runtime API is being built out.

## Permissions

- `events:read` - reads event edges from `nvrd`.
- `network:outbound` - posts to the configured webhook URL.
- `ui:settings.panel` - future settings panel for webhook URL and secret.

## Run Locally

```bash
go build -o event-webhooks ./plugins/event-webhooks/cmd/event-webhooks

NVR_BASE_URL=http://127.0.0.1:8085 \
NVR_API_TOKEN=dev-token \
CAMERA_ID=cam01 \
EVENT_TYPE=motion \
WEBHOOK_URL=https://example.com/nvr/events \
WEBHOOK_SECRET=shared-secret \
./event-webhooks
```

Webhook payload:

```json
{
  "plugin_id": "com.glidevizion.event-webhooks",
  "camera_id": "cam01",
  "event": {
    "id": 7,
    "time_ms": 1779742942165,
    "channel": 1,
    "event_type": "motion",
    "active": true
  }
}
```

When `WEBHOOK_SECRET` is set, requests include
`X-NVR-Signature: sha256=<hex hmac>` over the JSON body.
