Skip to main content
A copy-paste-runnable webhook receiver in Node + Express. Around 80 lines. Demonstrates the four things you have to get right: raw-body capture, constant-time signature compare, idempotency on x-klikit-event-id, and fast 2xx acknowledgement.
The source also lives in the partner-api repo at examples/webhook-receiver/node so you can clone it directly.

Run it

Listens on :8080 and exposes POST /webhooks/klikit.

Source

server.js

Hardening for production

The reference above runs as-is, but two things need real-world replacements before you put it in production:
  • seenEventIDs is in-memory. Replace with Redis (SET key NX EX 86400) or a Postgres unique index. An in-memory set evaporates on every restart, letting duplicates back in.
  • setImmediate is a single-process queue. For real throughput, push to a durable queue (SQS, Pub/Sub, RabbitMQ, BullMQ) and process from a separate worker so an OOM in your processor can’t drop events.