How to send browser push notifications from a Node.js app

preview_player
Показать описание

Resources

00:00 Introduction
00:51 Project setup
01:40 Project overview
03:20 VAPID keys explained
04:15 Server push library
06:22 Client-side code
11:01 Service worker explained
13:33 Push flow recap
14:48 Wrap up
Рекомендации по теме
Комментарии
Автор

Thank you, thanks for the help, practical example, article on the blog, congratulations!

andreluizmontanari
Автор

Great video well done dont know how you dont have so many followers for that great work

braitt
Автор

I think I came close to getting it working, I have all the code the same, but when I run it I didn't get the notification, but in the console I see it stopped at "Push Received", the subscribe call is still pending, but then nothing happened. I have notifications allowed, but never receive them in the browser.

JamieLeBlanc-mn
Автор

Thanks for the video just a quick question Have you tried doing this on a PWA ?

nelco
Автор

I’m getting an error registering the service worker. It says it’s not a secure operation and fails. Any idea why? I’ve been researching it, but haven’t found anything yet.

josephplaugher
Автор

Plz make video on web push notification in pwa using nextjs

yourskiss
Автор

Thanks for the overview of how this works. I have a few questions though on the practical implications.

It seems like the server is your web server that handles the web app. Could this be broken out to a standalone notification server? I am thinking something like lambda? if not for the entirety of the notification service at least for the push. Secondly how would to subscribe to multiple things? Like say an /all and a /myuser so that under /all anytime a notification is needed to go to everyone everyone gets its where as if there is a push specific to a given user a push could be done in a targeted manner. I don't know maybe in an e-commerce setting, a user adds things to their cart and leaves. or had added something to their cart but removed it and now that item is on sale.

JohnWeland