N
Nuxt2mo ago
hz2222

detect if a user is active

What is the best way to detect if the user is online or not? I am using Nuxt with supabase.
3 Replies
Cake
Cake2mo ago
you could probably use something like https://vueuse.org/core/useIdle/#useidle
Alan
Alan2mo ago
WebSocket, SSE or regular HTTP spam pooling
dmarr
dmarr2mo ago
just remember if you do something in a setTimout or setInterval, they will be stopped when the user changes tabs. so you'd want to move that to a service worker for it to stay alive
Want results from more Discord servers?
Add your server