pwa

Configure Serwist service worker and manifest for installable PWA with offline fallback.

Updated May 7, 2026
One-click install
npx skills add https://github.com/johinsDev/loyalty-app --skill pwa-johinsdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pwa
Source: https://github.com/johinsDev/loyalty-app/tree/main/.claude/skills/pwa
Command: npx skills add https://github.com/johinsDev/loyalty-app --skill pwa-johinsdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you make the apps/web Progressive Web App reliably installable and usable when the user loses connectivity.

Core Features & Use Cases

  • Installability checklist: Covers the exact requirements for getting the browser install prompt to appear (manifest, service worker fetch handler, HTTPS/localhost, and proper first-party navigation).
  • Offline experience: Ensures navigation gracefully falls back to a branded /offline page instead of showing an empty or confusing offline state.
  • Practical debugging: Walks through verifying manifest delivery, service worker activation, Lighthouse PWA signals, and icon refresh workflows that account for service worker caching.
  • Cache strategy guidance: Documents what should be precached vs. fetched at runtime (e.g., cache static assets/HTML appropriately while keeping auth-sensitive API/trpc traffic network-only).

Quick Start

Use the pwa skill to verify that apps/web has a working service worker, a valid /manifest.webmanifest, correctly rendered manifest icons, and an offline fallback page by following the install criteria and local development steps.

Frequently Asked Questions about pwa

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is required to make a Next.js PWA installable and show the browser install prompt?

To make a Next.js PWA installable, you need a valid web app manifest, a registered service worker with a fetch handler, HTTPS or localhost, and proper first-party navigation. These installability checklist items trigger the browser install prompt.

How do I add a branded offline fallback page when network navigation fails in a PWA?

To add a branded offline fallback page, configure your Serwist service worker to intercept HTML navigation requests and fall back to a dedicated `/offline` route when network requests fail. This provides a graceful offline experience instead of a confusing browser error.

How do I configure service worker cache strategies for static assets versus API calls?

Configure your service worker cache strategy by precaching static assets and HTML appropriately while keeping auth-sensitive API or tRPC traffic network-only. This separation ensures users get fast static loads without risking stale or cached protected data.

Why are my updated PWA manifest icons not showing up after a deployment?

Updated PWA manifest icons may not show because the service worker is serving cached versions of the manifest or icons. You need to follow an icon refresh workflow that accounts for service worker caching, verifying activation and cache invalidation to apply new branding.

Can I use Serwist for service worker setup in an existing Next.js web app?

Yes, you can use Serwist for service worker setup in an existing Next.js web app. The PWA configuration requires @serwist/next to manage service worker generation, HTML navigation fallbacks, and manifest delivery alongside your current application routing.

How do I debug PWA service worker behavior and verify Lighthouse PWA signals?

Debug PWA service worker behavior by verifying manifest delivery through the Next metadata route, checking service worker activation states in browser devtools, running Lighthouse PWA audits, and tracing cache hits and misses for navigation and asset requests.