When a server sends a push notification to a subscribed user, it needs to authenticate itself as the same server to which the user subscribed. To do this, there is an entire spec (called the VAPID spec) that dictates how this authentication works. Fortunately for us, the web-push package helps to abstract away most of these low-level details.

The one thing we do need to do, however, is generate a VAPID public/private key pair, and store it in a .env file so we can access those keys as environment variables.

#web dev #progressive #web apps #lightning web #components

[Part 2]: Using Lightning Web Components to Create Progressive Web Apps
1.10 GEEK