How to create real-time notifications in Nextjs?
Answered
Marble gall posted this in #help-forum
Marble gallOP
Hi ✌️ I'm using the following stack: Next.js + Drizzle + Neon. How can I create a real-time chat? Or create a dashboard with real-time notifications?
Answered by B33fb0n3
you can find a very good guide in the docs here: https://nextjs.org/docs/app/guides/progressive-web-apps#2-implementing-web-push-notifications
And of course the links that anay send are also pretty good
And of course the links that anay send are also pretty good
5 Replies
You can refer to code in Open Source Repos.
https://github.com/RiskyMH/EmailThing/blob/be09d3c38c7ba46b4377c7d675830595a938036c/apps/pwa/src/(app)/user-settings/notifications.tsx
https://github.com/RiskyMH/EmailThing/blob/be09d3c38c7ba46b4377c7d675830595a938036c/apps/api/src/routes/internal/user-settings/route.ts#L512
https://github.com/RiskyMH/EmailThing/blob/be09d3c38c7ba46b4377c7d675830595a938036c/apps/pwa/src/(app)/user-settings/notifications.tsx
https://github.com/RiskyMH/EmailThing/blob/be09d3c38c7ba46b4377c7d675830595a938036c/apps/api/src/routes/internal/user-settings/route.ts#L512
Longtail tuna
websocket (either selfhosted or 3rd party) or sse
@Longtail tuna websocket (either selfhosted or 3rd party) or sse
websockets wont work here with native notifications
@Marble gall Hi ✌️ I'm using the following stack: Next.js + Drizzle + Neon. How can I create a real-time chat? Or create a dashboard with real-time notifications?
you can find a very good guide in the docs here: https://nextjs.org/docs/app/guides/progressive-web-apps#2-implementing-web-push-notifications
And of course the links that anay send are also pretty good
And of course the links that anay send are also pretty good
Answer
@Marble gall solved?