A self-hosted notification backend — async queue, real-time delivery via Socket.io, offline sync, and API key auth. Ships in one deploy.
API server and worker are separate Node.js processes. Redis is the only bridge — no shared memory, no coupling.
POST /api/notify with recipient, type, payload
Validates, deduplicates via Redis SETNX, returns 202
setImmediate — prefs check, Mongo save, in-process emit
Socket.io delivers in real time. Offline users sync on reconnect.
Built around the patterns that actually matter when notifications fail in production.
POST /api/notify returns 202 after a single Redis SET NX.
Dispatch runs on the next tick via setImmediate — no queue, no broker,
no separate worker process to keep awake.
Dispatch checks io.sockets.adapter.rooms.get(userId) for
presence and calls io.to(userId).emit() directly. No Pub/Sub
bridge, no extra Redis hops.
API gate uses Redis SETNX with 24-hour TTL. Worker falls back to
a MongoDB sparse unique index. Sending the same request twice is safe — the
second returns 409 with no side effects.
Worker checks online:{userId} in Redis. Offline users accumulate
notifications with delivered: false. Socket.io flushes them the
moment the user reconnects.
Notifications running directly on this page. Configure and fire one, then copy the generated integration code.
No SDK required. Standard HTTP and Socket.io.
Open the dashboard, sign in, and request a key under Settings.
Keys are prefixed nx_ and stored as SHA-256 hashes —
shown once at creation.
Send your key in the Authorization: ApiKey header.
Include an Idempotency-Key to prevent duplicate
delivery — the queue handles retries and backoff automatically.
Connect with a JWT from POST /api/auth/token.
Subscribe to the notification event. Missed
notifications while offline are replayed on reconnect.
Open the dashboard to generate an API key and start sending notifications in minutes.