Skip to main content
This guide covers how to work with conversations: listing the user’s conversations, creating new ones, fetching a single conversation, and managing members.

Listing Conversations

useConversations fetches the authenticated user’s conversation list with cursor-based pagination. The list is sorted by most recent activity.
To filter by conversation type, pass a types array:
Each item in the list is a ConversationPreview — a Conversation extended with unreadCount and a truncated lastMessage.
The list is live. It reorders on new messages, inserts conversations as they’re created or added (including ones paginated out that receive a new message), removes conversations you leave or that are deleted, and self-heals on socket reconnect — across direct, group, and space chats. You don’t need to refetch it manually. See Real-time › Live Conversation List.
See useConversations for the full API.

Creating a Direct Conversation

Use useCreateDirectConversation to start a 1:1 conversation with another user. If a direct conversation between the two users already exists, the server returns the existing one.
See useCreateDirectConversation.

Creating a Group Conversation

Group conversations are created via useConversations, which exposes a createGroup function:
After creation, the new conversation is prepended to the conversation list in Redux state.

Accessing a Single Conversation

useConversation fetches full details for one conversation and provides update and deleteConversation actions:
The conversation is fetched once on mount if not already in Redux state. Real-time conversation:updated socket events keep it current automatically. See useConversation.

Managing Members

useConversationMembers loads the member list and exposes add, remove, leave, and role-change actions:
See useConversationMembers.

Space Conversations

Every Space has a single associated conversation. Use useFetchSpaceConversation to retrieve it:
See useFetchSpaceConversation.

Next Steps

Messages

Send and receive messages in a conversation

Real-time

Typing indicators, unread counts, read receipts