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

Panels


Differences from v6