What is Jopgood PWA?
Headless, type-safe primitives for managing push notification subscriptions, service-worker lifecycle, and browser permissions.
Jopgood PWA is a small core for the push-notification side of a PWA, plus optional framework adapters. No UI is included, and the service worker stays your responsibility.
Pre-release
The API will change before 1.0. Pin exact versions until then.
Why core + adapter?
Push subscriptions, the Notification permission, and the service-worker update lifecycle each have their own quirks. Most projects re-implement them, badly, in a useEffect. Jopgood PWA splits them out:
- @jopgood/pwa-core is a framework-agnostic class that holds the state.
- @jopgood/react-pwa is a React adapter - a provider plus hooks over the same store.
Technical notes
- Construction is safe on the server. Browser-only work runs in
mount(). - State lives in a single @tanstack/store instance and is surfaced through framework adapters.
- Written in TypeScript with strict types.
What it doesn't do
- Generate or host a service worker - you'll have to manage the
sw.jsfile yourself. Guide on MDN ↗ - Send push notifications - you'll need to run a push server (typically via
web-pushon Node) and handle POSTing the subscription to your backend. - Capture
beforeinstallpromptor manage install banners.