never loses data
Offline mutations queue and replay automatically. IDB-backed durability guarantees.
better-pwa is to PWAs what React Query is to server state — but for the entire app lifecycle.
npm install @better-pwa/core
Offline mutations queue and replay automatically. IDB-backed durability guarantees.
Background service worker swaps with zero session interruption.
Single source of truth via BroadcastChannel. Leader election, deduplication.
Batched, retried, with fallback UI hooks. Exponential backoff.
import { createPwa } from "@better-pwa/core"
createPwa({ preset: "saas" })
That one line sets up a service worker, manifest, state engine, offline queue, update lifecycle, multi-tab sync, and permission system. The preset made 100 configuration decisions for you.
Dashboards, CRMs, admin panels.
updateStrategy: "soft"
Cart persistence, checkout sync.
updateStrategy: "on-reload"
Field apps, spotty connectivity.
conflictResolution: "merge"
Blogs, media, reading apps.
permissionBehavior: "manual"
These aren't best practices. They are enforced invariants with runtime violation detection.
| Guarantee | What it means |
|---|---|
| Data Durability | User actions are never lost — offline or online |
| Update Safety | No broken sessions during deployments |
| Cross-Tab Consistency | One state everywhere, no stale tabs |
| Permission Resilience | Every denial has a recovery path |
| Cold Start Integrity | Deterministic boot regardless of cache state |
| Schema Evolution | State migrations prevent data loss on version upgrades |
| Resource Prioritization | Critical resources always synced before non-critical |