Skip to main content
Threads allow users to reply to a specific message in a focused side-conversation without cluttering the main message stream. Each top-level message can have replies, and the threadReplyCount field on the message shows how many replies exist.

How Threads Work

  • Any message can be the root of a thread (a parentMessageId of null).
  • Thread replies have parentMessageId set to the root message’s ID.
  • Threads are one level deep — replies cannot have their own threads.
  • The threadReplyCount on a root message is updated in real-time via the thread:reply_count socket event.

Using useMessageThread

useMessageThread is a convenience hook that combines message loading and sending for a specific message thread:
Replies are loaded in ascending order (oldest first) and loadMore fetches newer replies. See useMessageThread.

Using useLiveChatMessages Directly

For more control, use useLiveChatMessages with a parentId to load thread replies:

Showing the Reply Count

The root message object includes a threadReplyCount field. Use it to render a “View thread” button:
threadReplyCount is kept in sync automatically by ChatProvider when a new reply is sent by any participant.