How one developer built a reliable SMS-first alert system with email fallback in Node.js
A solo SaaS developer shared a practical approach to building urgent event notifications in Node.js after a critical alerting failure cost them three hours of undetected downtime. The flaw was assuming an HTTP 200 response from an SMS provider meant delivery, when it only confirms acceptance — the actual number had opted out weeks earlier. The solution uses a three-state model where an SMS is marked pending until a status poll confirms delivery, triggers an email fallback if nothing is confirmed within 90 seconds, and avoids webhooks in favor of simple polling for low-volume use cases. Idempotency keys tied to event IDs and a persisted fallback timestamp prevent duplicate alerts during repeated retries or flapping incidents. The entire implementation runs on Node 20 or later using plain fetch calls — no SDK required — making it easy to swap providers without restructuring the logic.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in