Overview
Returns the number of conversations that have at least one unread message. This value is fetched from the server onChatProvider mount and kept in sync via socket events.
Requires
ChatProvider in the component tree.Usage Example
Returns
Number of conversations with at least one unread message. Returns
0 before the first fetch completes.Notes
- When an event touches a conversation not currently loaded in the list (e.g. paginated out), this count reconciles automatically against the server’s authoritative unread summary — no remount required. It also reconciles on socket reconnect.
- To get the total number of unread messages (not conversations), use
useTotalUnreadCount. - For integration guidance, see Chat: Real-time.

