AI Integration Quick Reference
AI Integration Quick Reference
What’s New in v7
v7 is a ground-up rewrite that replaces global singletons with React-native patterns while keeping most component props compatible. The core shifts:Step-by-Step Migration Checklist
1. Update Dependencies
2. Update Initialization
The initialization pattern is nearly identical between v6 and v7. The only addition in v7 is wrapping your app inCometChatProvider:
v6
v7
3. Replace DataSource/Decorator with Plugins
v6
v7
4. Replace RxJS Event Subscriptions
v6
v7
5. Update Component Props
Most component props are unchanged. Key patterns to watch for:
For the full prop-by-prop reference, see Property Changes.
6. Update Theming (Minor)
CSS variables are the same between v6 and v7. The only change is how you set the theme:v6
v7
useTheme() hook for runtime switching:
7. Enable Calling (If Used)
Calling is now configured viaUIKitSettingsBuilder rather than a provider prop:
v7
.setCallingEnabled(true), call buttons are hidden and the Calls SDK is not loaded.
Architecture Changes
DataSource → Plugin System
v6 used a decorator pattern (DataSourceDecorator) to customize message rendering. v7 replaces this with a simpler plugin interface:
- Each plugin owns one or more message types
- Plugins provide
renderBubble(),getOptions(),getLastMessagePreview() - Default plugins are included automatically
- Custom plugins are passed via the
pluginsprop onCometChatProvider
RxJS Subjects → Unified Event Bus
v6 had separate RxJS Subject classes for each event category (CometChatMessageEvents, CometChatGroupEvents, CometChatCallEvents, etc.). v7 merges all events into a single typed pub/sub system:
- Subscribe:
useCometChatEvents((event) => { ... }) - Publish:
const publish = usePublishEvent() - SDK events (from network) and UI events (from components) flow through the same bus
Flat API → Compound Components
v7 components support both flat API (same as v6) and compound composition:Flat API (works same as v6)
Compound (new in v7)
Presentational Bubbles → Self-Extracting Bubbles
In v6, message bubble components (TextBubble, ImageBubble, etc.) were presentational — they received pre-extracted props likesrc, text, isSentByMe from the parent. The DataSource/plugin layer did the extraction and passed data down.
In v7, bubble components are self-extracting — they accept the SDK message object as their primary input and derive rendering state internally (attachments, text, sender info, alignment). Some bubbles retain optional override props (e.g., text and isSentByMe on CometChatTextBubble), but the standard usage is to pass only message.
v6 — presentational (parent extracts data)
v7 — self-extracting (bubble handles it)
CometChatTextBubble, CometChatImageBubble, CometChatVideoBubble, CometChatAudioBubble, CometChatFileBubble, CometChatPollBubble, CometChatStickerBubble, CometChatCallBubble, CometChatCollaborativeDocumentBubble, CometChatCollaborativeWhiteboardBubble, CometChatGroupActionBubble, and CometChatCallActionBubble.
Removed Concepts
Next Steps
Property Changes
Full prop-by-prop migration reference for every component
CometChatProvider
Provider setup with all props explained
Plugins
The new plugin system that replaces DataSource
Event System
Unified event bus replacing RxJS Subjects