supabase-client-realtime
Realtime WebSocket client for supabase-client.
Note: This crate is part of the
supabase-client-sdkworkspace. Most users should depend onsupabase-client-sdkwith therealtimefeature rather than using this crate directly.
Key Features
SupabaseClientRealtimeExtextension trait — adds.realtime()toSupabaseClientRealtimeClient— Phoenix Channels v1.0.0 protocol over WebSocket- Postgres Changes: listen for INSERT, UPDATE, DELETE events with table/column filters
- Broadcast: send/receive ephemeral messages between clients
- Presence: track and sync online user state with join/leave callbacks
set_auth()to update token on existing connections- Custom headers for WebSocket handshake via
RealtimeConfig - Automatic heartbeat and auto-reconnect with configurable backoff
- Works on both native (tokio-tungstenite) and WASM (web-sys WebSocket) targets
Usage
use SupabaseClientRealtimeExt;
use ;
let realtime = client.realtime?;
realtime.connect.await?;
let channel = realtime.channel
.on_postgres_changes
.subscribe
.await?;
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.