Skip to main content
The Unread Count component renders a badge showing the number of unread messages for the current User. Use it in navigation elements, icon buttons, or any element where you want to surface unread state.

Mount the component

The component updates in real time when new messages arrive, and hides itself when there are no unread messages, so you can keep the iframe permanently in your page.

Query parameters

Reading the count in your own code

If you want to render the count yourself instead of using the component, listen for the count-updated event the iframe emits via postMessage whenever the User reads a conversation or receives a new message:
The event payload looks like this: