Skip to main content

Notifications

The server supports two notification channels for reaching listeners and admins.

Web Push (web-push)

  • Listeners subscribe via POST /api/subscribe with a browser push subscription object.
  • The server stores subscriptions and can deliver web-push notifications (e.g. Now live: {artist} – {title} on LOKLOK FM, new shows, alerts).
  • The PWA frontend (public/manifest.json + sw.js) is the primary recipient — see PWA.

Subscription payload

{
"endpoint": "https://fcm.googleapis.com/…",
"expirationTime": null,
"keys": { "p256dh": "…", "auth": "…" }
}

WhatsApp

The server also integrates a WhatsApp channel for broadcast-style messaging (show alerts, listener polls, admin ops). This is used sparingly and is part of the same notifications module on the server.

Event sources

Notifications are triggered by:

  • New now-playing metadata (status → subscribed listeners)
  • Content pipeline events (new uploads, refreshes)
  • Manual admin broadcasts

Security notes

  • api/subscribe accepts only valid Web Push subscription shapes.
  • Stored subscriptions are purged when the browser drops them (push failure → unsubscribe).
  • The Icecast source password is never exposed via any endpoint; it lives in the deployment config (radio-engine.js remote config and the broadcast worker).