Send a push notification from Node.js
July 20, 2026 · 4 min read
Node 18+ ships fetch globally, so notifying your phone is literally one expression – no SDK, no npm install. Here are the patterns worth copying.
Setup (once, under a minute)
Install the Webhooky app (Android / iOS) – your endpoint URL is ready the moment it opens, no account needed.
The one-liner
await fetch("https://api.webhooky.app/YOUR_KEY", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ title: "✅ Deploy done", message: "v2.4.1 is live" }),
});
The catch-block pattern
async function notify(title, message, sound = "notification_1") {
try {
await fetch("https://api.webhooky.app/YOUR_KEY", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ title, message, sound }),
});
} catch {} // never let the alert break the job
}
try {
await chargeCustomer(order);
await notify("💶 Payment received", `Order ${order.id} · €${order.total}`, "cash_register");
} catch (err) {
await notify("🚨 Payment FAILED", String(err).slice(0, 500), "error_1");
throw err;
}
Catch crashes process-wide
process.on("uncaughtException", async (err) => {
await notify("🚨 Process crashed", String(err).slice(0, 500), "error_1");
process.exit(1);
});
The same idea works in an express error middleware or a PM2 restart hook – and of course in Firebase Cloud Functions and Supabase Edge Functions.
All fields
title, message, sound (one of 40 ids like cash_register or error_1) and vibrate – everything optional, everything per message. Details in the API docs; the Python version of this guide is here.
Get Webhooky
Free for your first 100 notifications – set up your endpoint in two minutes.