{"repo":"david-randoll/push-notification-nextjs","free":true,"listed":false,"github":"https://github.com/david-randoll/push-notification-nextjs","clone":"git clone https://github.com/david-randoll/push-notification-nextjs.git","description":"A sample project demonstrating how to send push notifications from a Next.js web app to iOS and Android devices.","language":"TypeScript","stars":51,"topics":["nextjs","notification","web-push","next-pwa","push-notification","push-notifications","pwa","web-push-notification","service-worker","notifications"],"license":"MIT","category":"mobile-apps","readme_excerpt":"A sample project for push notifications with Next.js. The app used web push notifications to send messages to users. The notification should work on all devices and browsers. Apple devices need iOS 16.4+ and the site added to the Home Screen. See Platform requirements for the per-browser conditions. main targets Next.js 16 (App Router, Turbopack, React 19, Tailwind CSS v4). If you are still on an older Next.js, the Next.js 14 version of this sample is kept as a reference on the nextjs-14 branch — it uses webpack, React 18, Tailwind CSS v3 and next-pwa . Demo A live demo of the project can be found here Running Locally First, run the development server: Run the below command to generate the vapid keys. Once you have the keys, rename the .env.example file to .env and insert the keys. or Start the development server: Open http://localhost:3000 with your browser to see the result. How it works The app uses the web-push package to send push notifications. The app has a service worker that listens for push events and displays the notification. Using just this package is enough to send push notifications from most devices and browsers. However, a few platforms have their own conditions, and none of them report a useful error when they are not met. The app checks for them up front and shows the user what to do instead of a raw failure. Platform requirements Everywhere, the page has to be served over HTTPS with a valid certificate ( localhost is exempt). Without a secure context the b","default_branch":null,"files":null,"tree":[],"storefront":"/r/david-randoll","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/david-randoll/push-notification-nextjs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}