You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add explanation of Realtime Broadcast usage in Realtime Chat (supabase#40882)
Adds a section explaining that Realtime Chat uses Realtime Broadcast, does not
store messages by default, and relies on onMessage for persistence. Improves
developer understanding of expected behavior.
The Realtime Chat component provides a complete chat interface that enables users to exchange messages in real-time within a shared room.
22
22
23
+
## How it works under the hood
24
+
25
+
This chat component uses **Supabase Realtime Broadcast** to send and receive messages between connected clients.
26
+
27
+
Messages sent through Broadcast are:
28
+
29
+
- delivered in real time to other connected clients
30
+
-**not stored** unless you handle persistence yourself
31
+
-**not guaranteed** to arrive if the client disconnects
32
+
- scoped to a specific `roomName`, which corresponds to a broadcast channel
33
+
34
+
This design keeps latency extremely low, but it means you should use the `onMessage` callback if you want to store messages permanently or show chat history on page load.
0 commit comments