Webhooks & Event Verification
Receive real-time delivery confirmations and verify HMAC SHA-256 signatures.
# Webhooks & Event Verification
NotifySetu delivers HTTP webhooks with guaranteed at-least-once delivery for notification lifecycle events.
Supported Event Types
| Event | Description | |---|---| | `notification.delivered` | Upstream provider confirmed handset/inbox delivery | | `notification.failed` | All carrier retry attempts failed | | `email.bounced` | Hard or soft bounce returned by receiving mail exchanger | | `otp.verified` | 6-digit one-time password validated successfully |
Verifying Signatures
Every webhook payload includes an `X-NotifySetu-Signature` header signed using HMAC SHA-256 and your destination secret:
import crypto from "crypto";export function verifyWebhookSignature( rawBody: string, signatureHeader: string, secret: string ): boolean { const hmac = crypto.createHmac("sha256", secret).update(rawBody).digest("hex"); return crypto.timingSafeEqual(Buffer.from(hmac), Buffer.from(signatureHeader)); } ```