web-push-demo

Example application using web Push API

MIT License

Stars
0

Push API Demo

This is an example project presenting how to send Push Notifications to the browser. The notification is send using VAPID authentication method.

See it in action

https://notifications-demo.ertrzyiks.me

How it works

Client side components:

Server side components:

Browser support

For the most recent information refer to: https://caniuse.com/#feat=push-api,notifications,serviceworkers

Installation

  1. Install npm dependencies
yarn install
  1. Copy .env.sample file as .env
  2. Generate VAPID keys
yarn web-push generate-vapid-keys
  1. Save the provided keys in the .env file as
VAPID_PRIVATE_KEY=BEkyy4.....ef7graNA
VAPID_PUBLIC_KEY=B5A.....dRE
  1. Update value of VAPID_EMAIL in the .env file
  2. Start the server
yarn start

Useful links