AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Package | @cometchat/chat-uikit-angular |
| Key services | MessageBubbleConfigService, ConversationSubtitleService, MessageListService |
| Required setup | CometChatUIKit.init(uiKitSettings) then CometChatUIKit.login("UID") |
| Purpose | Add custom message types with custom bubble templates, subtitle overrides, and fetch inclusion |
| Features | Custom bubble rendering, subtitle formatting, icon overrides, message type fetching |
| Related | Message Bubble | Conversations | Message List |
| Capability | Description |
|---|---|
| Custom bubble templates | Register ng-template views for new message types |
| Conversation subtitle override | Control last message text per message type |
| Icon overrides | Set custom icons for conversation list items |
| Fetch inclusion | Include custom types in the message request builder |
Custom Message Bubble
UseMessageBubbleConfigService to register templates for custom message types. The message type key format is {type}_{category} (e.g., location_custom).
Register a Custom Content View
$implicit context, so let-message gives you full access to the CometChat.BaseMessage.
Full Bubble Override
To replace the entire bubble structure (header, content, footer, status), register abubbleView:
bubbleView template context includes $implicit (message), alignment, and group.
Partial Override
Register only the parts you want to customize. Unregistered parts use defaults:Conversation Subtitle Override
UseConversationSubtitleService to control the last message text shown in the conversation list for specific message types.
Register a Subtitle Formatter
Override Subtitle Icon
Unregister
Custom Message Fetching
By default, the message list fetches these types and categories: Default Types:text, file, image, audio, video, groupMember, form, scheduler, card, assistant, extension_sticker, extension_poll, extension_whiteboard, extension_document, meeting
Default Categories: message, custom, call, interactive, agentic, action (action is excluded when hideGroupActionMessages is true)
Inspect Current Defaults
Add Custom Types and Categories
Append to the existing defaults:Replace Types and Categories Entirely
Fully replace the defaults with your own list:null to revert to the built-in defaults:
Remove Custom Types
If you provide a custom
MessagesRequestBuilder via setMessagesRequestBuilder, custom types/categories registered via addCustomMessageTypes/addCustomMessageCategories are not appended. The custom builder is used as-is.End-to-End Example: Location Sharing
A complete example showing a custom “location” message type with bubble template, subtitle override, and fetch inclusion.- Component
- Sending a Location Message
API Reference
MessageBubbleConfigService
| Method | Description |
|---|---|
setBubbleView(typeKey, partMap) | Register templates for a message type |
setMessageTemplates(maps) | Register templates for multiple types at once |
setGlobalView(part, template) | Set a global template for a bubble part |
getView(typeKey, part) | Get the configured template for a type and part |
ConversationSubtitleService
| Method | Description |
|---|---|
registerSubtitleFormatter(typeKey, formatter) | Register a subtitle formatter callback |
unregisterSubtitleFormatter(typeKey) | Remove a subtitle formatter |
registerSubtitleIconOverride(typeKey, iconName) | Override the subtitle icon |
getSubtitle(typeKey, message) | Get formatted subtitle (or null) |
getIconOverride(typeKey) | Get icon override (or null) |
hasFormatter(typeKey) | Check if a formatter is registered |
MessageListService
| Method | Description |
|---|---|
getAllMessageTypes() | Get the current effective list of message types |
getAllMessageCategories() | Get the current effective list of message categories |
addCustomMessageTypes(types) | Append custom types to the defaults |
addCustomMessageCategories(categories) | Append custom categories to the defaults |
setMessageTypes(types) | Replace the entire types array (pass null to reset) |
setMessageCategories(categories) | Replace the entire categories array (pass null to reset) |
removeCustomMessageTypes(types) | Remove previously added custom types |
removeCustomMessageCategories(categories) | Remove previously added custom categories |
Next Steps
Message Bubble
Customize the message bubble component.
Conversations
Customize the conversations list.
Localization
Override text and translations.
Date/Time Formatting
Customize date and time display.