What problem does it solve?
Prevents broken or inconsistent Progressive Web App behavior in the TimeKast Starter Kit by providing a safe, production-ready Serwist Service Worker setup with a managed update flow and install UX.
Core Features & Use Cases
- Service Worker in the kit’s canonical location: Implements precaching and tightly-scoped runtime caching using
src/app/sw.ts (fonts, images, CSS, and controlled /_next/image), while explicitly avoiding navigations, RSC, /api/*, and Next-action POSTs to prevent hydration/auth/stream failures.
- Managed update UX with opt-in activation: Uses
PwaUpdateToast to detect a waiting Service Worker and prompts the user to reload via an explicit “Recargar” button instead of silent takeover.
- Install prompt patterns across platforms: Provides
PwaInstallToast for Chromium/Android and IosA2hsHint for iOS Safari, including route gating and one-shot/cooldown storage.
- Push reception and click navigation contract: Handles VAPID push inside the SW and forwards notification clicks to the client using the
SW_NAVIGATE postMessage contract.
- Manifest and icon asset wiring: Documents the shipped icons under
public/pwa/ and the expected manifest integration via src/app/manifest.ts.
Quick Start
Use sk-pwa whenever you integrate the TimeKast Starter Kit with offline caching, install prompts, SW updates, or VAPID push—by aligning your changes to the kit’s canonical Service Worker at src/app/sw.ts and its managed update flow in PwaUpdateToast.