Overview
Fetches the authenticated user’s conversation list with cursor-based pagination. Conversations are sorted by most recent activity. The hook also exposes acreateGroup function to create new group conversations.
Requires
ChatProvider in the component tree.Usage Example
Props
Filter conversations by type. If omitted, all types are returned.
Returns
The loaded conversations sorted by most recent activity. Each item is a Conversation extended with
unreadCount and a truncated lastMessage.true while a fetch is in progress.true if there are more conversations to load.Fetches the next page of conversations and appends them to the list. No-ops if
loading is true or hasMore is false.Resets the cursor and re-fetches the conversation list from the beginning.
createGroup
(params: { name?: string; metadata?: Record<string, unknown> }) => Promise<ConversationPreview>
Creates a new group conversation and prepends it to the loaded list. Resolves to the created
ConversationPreview.Notes
- The initial fetch runs on mount. Re-runs automatically when the authenticated project changes.
- New messages received via socket update the
lastMessageandlastMessageAtof the relevant conversation in the list automatically — no manual refresh needed. - For integration guidance, see Chat: Conversations.

