Notifications
Configure push notifications using VAPID (Voluntary Application Server Identification) keys to enable browser-based push notifications for your users.
Push Notifications (VAPID)
Push notifications allow you to send real-time notifications to users even when they're not actively using your application. This is useful for alerts, updates, reminders, and engaging users with timely information.
Generate local keys
You can generate VAPID keys using an online tool or npm package:
npx web-push generate-vapid-keysDefine local subject
Define the URL to your contact form (this will be used as the VAPID subject)
http://localhost:3000/contactAdd to local env
Add the following to your .env file:
/apps/fastack-boilerplate/.env
Optional
VAPID_PUBLIC_KEY=BKxxxxxxxxxxxxxxxxxxxxxxxxxx
VAPID_PRIVATE_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxx
VAPID_SUBJECT=http://localhost:3000/contactGenerate production keys
You can generate VAPID keys using an online tool or npm package:
npx web-push generate-vapid-keysDefine production subject
Define the URL to your contact form (this will be used as the VAPID subject)
https://yourdomain.com/contactAdd to production env
Add the following to your .env.production file:
/apps/fastack-boilerplate/.env.production
Optional
VAPID_PUBLIC_KEY=BKxxxxxxxxxxxxxxxxxxxxxxxxxx
VAPID_PRIVATE_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxx
VAPID_SUBJECT=https://yourdomain.com/contact