This should be enough to get you started with web push notifications.
### Notes
- The `pushManager.subscribe` method may require depending on the browser a `userVisibleOnly` field or `applicationServerKey` field. The `userVisibleOnly`
field should be set to `true` and the `applicationServerKey` field should be set to the public key you generated earlier.
- For sending a payload additional changes need to happen, you can't just send a payload with the request.
- For it to work you will have to update the headers:
- Encoding the payload, it's complex and I haven't done it yet but you can look at the [Mozilla Blog](https://blog.mozilla.org/services/2016/08/23/sending-vapid-identified-webpush-notifications-via-mozillas-push-service/) for more information.
- The `Crypto-Key` header should be set to 3 values:
-`p256ecdsa=${publicKey}` - The public key you generated earlier
-`dh=${publicHalfKey}` - The first half of the shared secret when the payload is encoded
-`keyid=p256dh` - The key id
- The `Encryption` header should be set to 2 values:
-`salt=${salt}` - The salt used to generate the shared secret
-`keyid=p256dh` - The key id
- The `Content-Encoding` header should be set to `aesgcm`
For more information you can check the useful links below.
### Useful links
- [The Web Push Protocol ](https://web.dev/articles/push-notifications-web-push-protocol)