This is a basic demo for web push notifications. For this demo to work, you need to address the following:
- Generate VAPID keys. You can use web-push cli. (npx web-push generate-vapid-keys) Or generate it online.
- Replace PUBLIC_KEY on both server and client side with your keys.
- Create .env.local files on server side.
- Declare PRIVATE_KEY on your new .env.local file.
- Run
yarn
andyarn start
to startup both apps. - Go to http://localhost:8080 on your browser.
- Click
Push Event
button.