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