What: Add a webhook system that notifies external services when events occur (enrollment, quiz completion, credential mint, reward claim).
Why: External services (analytics, CRM, notification services) need real-time event notifications. Currently there's no push mechanism — services must poll the API.
Scope: Create webhooks table with url, events array, secret, active flag. Add src/services/webhook-dispatcher.ts that signs and sends webhook payloads. Register webhook management endpoints for admins.
Acceptance criteria:
- Webhooks are dispatched for configured events
- Payloads are signed with HMAC for verification
- Failed webhooks are retried with exponential backoff
- Admins can manage webhooks via API
Technical context:src/audit/index.ts — audit event pattern. src/services/retry-queue.ts — retry pattern.
What: Add a webhook system that notifies external services when events occur (enrollment, quiz completion, credential mint, reward claim).
Why: External services (analytics, CRM, notification services) need real-time event notifications. Currently there's no push mechanism — services must poll the API.
Scope: Create
webhookstable with url, events array, secret, active flag. Addsrc/services/webhook-dispatcher.tsthat signs and sends webhook payloads. Register webhook management endpoints for admins.Acceptance criteria:
Technical context:
src/audit/index.ts— audit event pattern.src/services/retry-queue.ts— retry pattern.