help to implement User Notifications
Answered
Least Tern posted this in #help-forum
Least TernOP
Hello, I am using nextauth with prisma and i want to add notification icon on navbar to let the user see all notifications.
Should I implement socket or an event listener for live notification count on the backend?
Should I implement socket or an event listener for live notification count on the backend?
Answered by B33fb0n3
I don't think so. I would use react query (clientside) fetch for it. Then it refetch everytime the user focus the page or via an intervall of for example 1 minute. Like that you should be good to go
12 Replies
@Least Tern Hello, I am using nextauth with prisma and i want to add notification icon on navbar to let the user see all notifications.
Should I implement socket or an event listener for live notification count on the backend?
How important is it, that the user directly see's the change, when there is new data?
Least TernOP
So basically i need to inform the user that its schedule is starting soon and also i would like to inform stores about comments on their page
ita like salon scheduling app
@B33fb0n3 How important is it, that the user directly see's the change, when there is new data?
Least TernOP
do you think that it shouldnt be realtime?
@Least Tern do you think that it shouldnt be realtime?
I don't think so. I would use react query (clientside) fetch for it. Then it refetch everytime the user focus the page or via an intervall of for example 1 minute. Like that you should be good to go
Answer
Least TernOP
yeah that majes sense
its not a social media platform 😅
yeah i will go with interval refetch
yea, I guess that's a good solution 👍
happy to help. Please mark solution
Least TernOP
Thank you so much for the suggestion 😁