All integrations

Browser push (VAPID)

A server you run can send push notifications, which reach the system's notification centre with the page closed, to a browser that has subscribed through the server's API. The web app on safeos.sh makes no push subscription: its notifications come from the open page, so nothing alerts with the browser closed. This page sets up the server's side, which needs VAPID keys.

Generate VAPID keys

VAPID keys identify your server to the browser's push service (Mozilla, Apple, Google). Generate a pair with the web-push CLI (already a SafeOS dependency):

npx web-push generate-vapid-keys

Then add them to your API server's .env:

VAPID_PUBLIC_KEY=BPxxxxxx...
VAPID_PRIVATE_KEY=xxxxxx...
VAPID_EMAIL=admin@yourdomain.com

VAPID_EMAIL is contact info for the push service — use a real address.

What subscribes

A client you build subscribes: it calls the browser's PushManager.subscribe with the server's VAPID public key, then posts the subscription to POST /api/notifications/subscribe while signed in to the server.

The browser setting on Settings → Notifications turns on the open page's own notifications. It makes no push subscription.

iOS limitations

Apple supports web push only when the PWA is installed to the home screen and only in iOS 16.4+. Background push cannot work in a normal Safari tab. If a user can't install, fall back to email or SMS alerts.

Reference: web.dev push notifications overview.