> PWA Push Notifications
Send web push notifications to PWA users even when the app is closed.
fetch
$
curl "https://skillshub.wtf/skillshub-team/catalog-batch5/pwa-push-notifications?format=md"SKILL.md•PWA Push Notifications
PWA Push Notifications
Subscribe
const reg = await navigator.serviceWorker.ready;
const sub = await reg.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: urlBase64ToUint8Array(VAPID_PUBLIC_KEY),
});
await fetch('/api/push/subscribe', { method: 'POST', body: JSON.stringify(sub) });
Service Worker Handler
self.addEventListener('push', (e) => {
const data = e.data?.json() ?? { title: 'Update', body: 'New content' };
e.waitUntil(self.registration.showNotification(data.title, {
body: data.body, icon: '/icon-192.png', data: { url: data.url || '/' },
}));
});
self.addEventListener('notificationclick', (e) => {
e.notification.close();
e.waitUntil(clients.openWindow(e.notification.data.url));
});
Server (web-push)
import webpush from 'web-push';
webpush.setVapidDetails('mailto:admin@app.com', PUBLIC_KEY, PRIVATE_KEY);
await webpush.sendNotification(subscription, JSON.stringify(payload));
> related_skills --same-repo
> Nix Dev Shells with direnv
Auto-activate reproducible dev environments with Nix flakes and direnv.
> Dagger with GitHub Actions
Run Dagger CI/CD pipelines in GitHub Actions for portable, testable builds.
> Bun + Hono API
Build fast APIs with Bun runtime and Hono framework.
> Deno Fresh Framework
Build full-stack web apps with Fresh on Deno. Islands, routes, and zero runtime overhead.
┌ stats
installs/wk0
░░░░░░░░░░first seenMar 18, 2026
└────────────