pwa-push-notificationslisted
Install: claude install-skill Verstige/pwa-push-notifications
# PWA and Web Push
## Purpose
Make a web application installable and deliver user-authorized notifications. Examples must use synthetic users, endpoints and application names.
## Implementation
1. Serve over HTTPS, with localhost as a development exception. Add a web app manifest with a name, start URL, display mode and suitable icons.
2. Register a service worker at the intended scope. Version caches and remove obsolete cache versions on activation. Never cache authenticated API responses or private account pages by default.
3. Show an explicit Enable notifications control. Request permission only after the user activates it; explain what notifications they will receive.
4. Generate VAPID keys for each environment. Publish the public key only. Store the private key and provider credentials on the server.
5. Subscribe using PushManager and the public key. Send the subscription to an authenticated server route. Associate it with the current user on the server, not a client-supplied user ID.
6. Authorize every send. Evaluate the recipient's current permissions and preferences from a shared server-side policy. Do not copy business access thresholds into notification routes.
7. Queue sends with bounded retries. Treat expired subscriptions as inactive; distinguish provider acceptance from actual device display.
8. Handle push events with event.waitUntil and showNotification. Use notificationclick to focus an existing allowed application URL or open one. Reject arbitrary extern