For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.
C#: Unsubscribe from a channel
Unsubscribes and removes Realtime channel from Realtime client.
Removing a channel is a great way to maintain the performance of your project's Realtime service as well as your database if you're listening to Postgres changes. Supabase will automatically handle cleanup 30 seconds after a client is disconnected, but unused channels may cause degradation as more clients are simultaneously subscribed.
To remove every channel and close the socket in one call, use RemoveAll().
Examples
Remove a channel
var channel = await supabase.From<City>().On(ListenType.All, (sender, change) => { });
channel.Unsubscribe();
// OR
var channel = supabase.Realtime.Channel("realtime", "public", "*");
channel.Unsubscribe()