In This Section
Setup
Add
ChatProvider to your component tree to initialize the socket connectionConversations
Create direct and group conversations, list conversations, manage members
Messages
Send, edit, delete, and react to messages with optimistic UI updates
Real-time
Socket events, typing indicators, unread counts, and read receipts
Threads
Threaded replies to messages for focused side-conversations
Architecture
Chat is built around a two-level provider hierarchy:ChatProvider establishes the Socket.io connection and maintains global state (unread counts, message store). Individual components then use the hooks directly — there is no second-level context required for basic usage.
For space chat, use useFetchSpaceConversation to retrieve the conversation associated with a space, then interact with it using the same hooks used for any other conversation.
Conversation Types
| Type | Description |
|---|---|
direct | 1:1 conversation between two users |
group | Multi-user conversation created explicitly |
space | Conversation automatically tied to a Space |
Next Steps
Start with Chat Setup to addChatProvider to your app.
