SupabaseS
Supabase4y ago
foci

Disconnecting user from presence

I want to show a list of active users in a room. There's very clearly a client API for creating the channel and configuring the users' presences, but how do I programmatically get a user to disconnect/leave a channel?

Right now my code just permanently marks them as in the room once they join, and is unable to capture when they leave. I feel it's quite basic but I'm really unclear on what exactly emits the 'leave' event on here: https://supabase.com/docs/guides/realtime/quickstart, how does supabase know when a client leaves?I want the user session to persist, just their presence in the room to go away.
Was this page helpful?