AI Integration Quick Reference
AI Integration Quick Reference
Common Patterns
These 8 patterns apply across all components. You do not need to look them up per-component:Changes Within v7
Most of this page maps v6 to v7. These props existed in an earlier v7 release and were removed by a later one, so they affect you only if you are upgrading from one v7 version to another.CometChatConversations
Modified Props
Removed Props
New Props
CometChatMessageList
Modified Props
Removed Props
textFormatters was removed in 7.0.0 and the prop is back in 7.2.0. On 7.0.x–7.1.x it is unavailable and formatting must go through a plugin. Most v6 formatter classes carry over — see Porting a v6 formatter for what changes.Porting a v6 formatter
The rule: in v7 a formatter works on text, never on the message. A string goes in, a string comes out. Composer-side formatters still get live-input access — the composer assignsinputElementReference, calls initializeComposerTracking(), fans keystrokes to onKeyUp()/onKeyDown(), and provides getCaretPosition()/setCaretPosition() — but only when enableRichTextEditor is set on the composer. What no longer reaches a formatter is the message object and the logged-in user, so every v6 member carrying that context is gone — along with the v6 hooks the kit used to call.
Text Formatters is the reference for the v7 class: every member, who calls it, and what happens if you override it. This section covers only what changes when you bring a v6 class to it.
Three outcomes, in the order you will meet them:
Compile errors
id is the only abstract member. A v6 subclass fails with TS2515: … does not implement inherited abstract member id until you add one:
id, so two formatters sharing one id leave only the last, and reusing a built-in id (markdown-formatter, mentions-formatter, url-formatter) replaces that built-in. Plain JavaScript runs without an id, but every id-less formatter collapses onto the same key — declare one.
getFormattedText() changed signature to (inputText?: string) => string. Two v6 shapes no longer type-check, both reported as TS2416:
- returning
undefinedfor empty input — return""instead; - the two-parameter form
getFormattedText(text, params)— v7 passes one argument, so a second parameter is never populated and reading it throws.
Where your transform has to live
v7 callsformat(), whose default stores state and delegates to getFormattedText() and then to customLogicToFormatText(). Whether your v6 transform still runs depends on where you put it:
Members v7 removed
Calling one of these is a compile error in TypeScript (TS2339) and a TypeError in JavaScript. Reading one of the fields gives undefined, which throws as soon as you dereference it.
Helpers: setStyle() · getStyle() · setClasses() · setCssClassMapping() · setId() · getId() · setMessage() · getMessage() · setLoggedInUser() · getLoggedInUser() · setComposerConfig() · getComposerConfig() · setMessageBubbleAlignment() · getMessageBubbleAlignment() · setCaretPositionAndRange() · addAtCaretPosition() · getPrecedingText() · checkPreviousCharacterUsingRange() · debounce() · cleanup() · stopTracking() · getKeyUpCallBack() · getKeyDownCallBack()
Fields: messageObject · loggedInUser · user · group · composerId · messageBubbleAlignment · classes · cssClassMapping · textStyle · timeoutID
Caret fields with a v7 replacement: currentCaretPosition and currentRange are gone, but caret access is not — use getCaretPosition() and setCaretPosition().
Apply styling with CSS against your own class names rather than setStyle/setClasses.
Hooks v7 no longer calls
Nothing surfaces these: your method stays on the class, nothing throws, and it is simply never invoked. This is the category to audit by hand. Some names appear in both lists — calling one of them is an error, overriding it is silent.Attaching data at send time
v6’sformatMessageForSending() let a formatter stamp the outgoing message — tags, metadata — just before it went out. v7 has no formatter hook for this: nothing hands a formatter the message. The composer’s onSendButtonClick does not help either, because it fires after the SDK call with the confirmed message.
Move the logic to the composer’s sendTextMessageOverride, which is called instead of the kit’s own send, so you build and send the message yourself:
Live input is now yours to drive
v6’s baseonKeyUp() watched for trackCharacter, then called debouncedFormatTextOnKeyUp() for you. v7’s base onKeyUp() only forwards to the callback set by setKeyUpCallBack(), and formatText() runs only when the composer enters rich-text edit mode. v7 never reformats the live input on keystrokes by itself.
A v6 formatter that relied on that inherited behaviour compiles, and then does nothing as you type. Call formatText() from your own onKeyUp() override (or from the callback you register) to restore it. Do not do both — registering your own onKeyUp via setKeyUpCallBack() while also overriding onKeyUp() and calling super.onKeyUp() recurses until the stack overflows. Set your tracking state explicitly too: on the v7 base class trackCharacter starts as '' and regexPatterns as [], so call setTrackingCharacter() and setRegexPatterns() in your constructor rather than relying on an inherited default.
New Props
CometChatMessageComposer
Renamed Props
New Props
CometChatMessageHeader
Modified Props
Removed Props
New Props
CometChatThreadHeader
Removed Props
New Props
CometChatUsers
Removed Props
CometChatGroups
Removed Props
New Props
CometChatGroupMembers
Modified Props
Removed Props
New Props
CometChatIncomingCall
Removed Props
New Props
CometChatOngoingCall
New Props
CometChatMessageBubble
Renamed Props
Modified Props
Removed Props
New Props
CometChatContextMenu
Renamed Props
Modified Props
CometChatConfirmDialog
All string/callback props moved to compound sub-components:
New root-level props:
isOpen, onClose, closeOnOutsideClick, variant.
The compound sub-components are CometChatConfirmDialog.Root, .Icon (optional leading icon, new in v7), .Content, and .Actions.
CometChatActionSheet
All props moved to compound pattern:
New root-level props:
isOpen, onClose, layoutMode, title.
CometChatCheckbox
Renamed Props
CometChatChangeScope
Renamed Props
Modified Props
CometChatDate
Renamed Props
New Props
CometChatReactions
Renamed Props
Modified Props
CometChatReactionList
Renamed Props
CometChatFullScreenViewer
Renamed Props
Removed Props
New Props
CometChatImageBubble → CometChatImagesBubble
In v7, the image bubble is renamedCometChatImagesBubble and is self-extracting: pass the SDK message and the bubble derives its own attachments, caption, and alignment (and renders multiple images in a grid). The pre-extracted data props from v6 are gone.
Removed Props
New / Current Props
The other media bubbles likewise default to their multi-attachment v7 components:
CometChatVideoBubble → CometChatVideosBubble, CometChatFileBubble → CometChatFilesBubble, and CometChatAudioBubble → CometChatAudiosBubble (attached audio files) or CometChatVoiceNoteBubble (recorded voice notes). The singular CometChat*Bubble components still ship and can be used standalone — only the default routing changed. This self-extracting pattern applies to all message bubbles in v7 (CometChatTextBubble, CometChatPollBubble, CometChatStickerBubble, CometChatCallBubble, and the action/collaborative bubbles too): each takes the SDK message and derives its own data. See Message Bubble.CometChatSearchBar
Modified Props
New Props
CometChatButton
Renamed Props
Modified Props
New Props
Next Steps
Migration Overview
Architecture changes and step-by-step checklist
Components Overview
Browse all v7 components