Skip to main content

Overview

The v7 event system merges CometChat SDK listener events (from the network) with local UI events (from component actions) into a single pub/sub bus. Components subscribe to events they care about and publish events when they perform actions that other components need to know about. This replaces v6’s RxJS-based CometChatMessageEvents, CometChatGroupEvents, etc. with a single unified system.

How It Works

  1. SDK listeners are attached when CometChatEventsProvider mounts (after login)
  2. When the SDK fires a listener callback, it’s converted to a typed event and emitted to all subscribers
  3. Components can also publish UI events for local cross-component communication
  4. All subscribers receive all events — filter by event.type in your handler

Subscribing to Events

Use the useCometChatEvents hook to subscribe:
The hook automatically subscribes on mount and unsubscribes on unmount. No cleanup needed.

Publishing UI Events

Use the usePublishEvent hook to publish events that other components can react to:
Only ui: prefixed events can be published by components. SDK events are emitted internally by the provider.

SDK Events

These events originate from the CometChat SDK (network). They fire when other users perform actions.

Message Events

Receipt Events

Reaction Events

Typing Events

User Events

Group Events

Call Events

Connection Events


UI Events

These events are published by UI Kit components for local cross-component communication within the same tab.

Message Lifecycle

Composer Commands

Conversation State

User & Group Actions

Thread

Call Actions

Card Actions

Published when a user clicks an action (button, link, etc.) inside a card message bubble. The kit performs no behavior — it forwards the raw action and its message to your app, so you own all action handling. This is the only channel that can reach a kit-instantiated card (e.g. a nested agent card) where no prop is reachable.

Panels


Differences from v6