Skip to main content
Progressive Web Applications (PWAs) combine the reach of web apps with native app features like offline support, push notifications, and home screen installation—all from a single codebase without app store approvals.

Creating a PWA

1

Create the web app manifest

Create app/manifest.ts to define your app’s metadata:
Use a favicon generator to create icon sets and place them in public/.
2

Implement push notifications

Create the main page component with push notification management:
3

Create Server Actions for notifications

4

Generate VAPID keys

Install web-push globally and generate keys:
Add the output to your .env file:
5

Create the service worker

6

Add security headers

Configure security headers in next.config.js, especially for the service worker:

Home screen installation

For a PWA to be installable, you need:
  1. A valid web app manifest (created in step 1)
  2. The site served over HTTPS
Modern browsers automatically show an install prompt when these criteria are met. For iOS, users must manually tap ShareAdd to Home Screen.

Testing locally

To test push notifications locally:
  • Accept notification permissions when prompted
  • Ensure browser notifications are not globally disabled

Offline support

For offline functionality, use Serwist with Next.js. See their documentation for integration steps.
The Serwist plugin currently requires webpack configuration.