Skip to main content

Overview

Whistle pushes events to URLs you configure in Settings → Developer → Webhooks (outbound from Whistle, inbound to your stack). Each POST is signed so you can reject forged traffic. Endpoint URLs and secrets are managed in the dashboard, not through the SDK.

Event types

Request envelope

Each delivery body is a JSON object:
  • id — unique event ID. Use for idempotency and deduplication.
  • type — the event name from your subscription.
  • createdAt — ISO 8601 timestamp of when the event occurred.
  • data — event-specific payload.

HTTP headers

Whistle sends POST with Content-Type: application/json; charset=utf-8 and:

Verifying signatures with the SDK

The SDK provides verifyWebhookSignature to verify incoming webhooks. It parses the signature header, checks the timestamp, computes the HMAC, and returns the typed event.

Next.js App Router

Express

Manual verification

The x-whistle-signature header has the format:
  1. Parse the timestamp t and signature v1 from the header.
  2. Reject if the timestamp is older than your tolerance (recommended: 300 seconds).
  3. Compute HMAC-SHA256 of the string <t>.<rawBody> using your signing secret.
  4. Compare the resulting hex digest to v1 using constant-time comparison.
The raw body must be the exact bytes Whistle sent. Verify before JSON parsing.

Retries and logs

Failed deliveries retry with backoff. Treat x-whistle-delivery-id (or the envelope id) as your idempotency key so a retried POST does not double-apply side effects. The View deliveries panel in the dashboard shows status, HTTP status codes, errors, and payload snapshots for recent attempts.