N
Nuxt3w 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
Cake3w ago
you could probably use something like https://vueuse.org/core/useIdle/#useidle
Alan
Alan3w ago
WebSocket, SSE or regular HTTP spam pooling
dmarr
dmarr3w 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