AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Package | @cometchat/chat-uikit-angular |
| Key components | cometchat-group-members, cometchat-message-list, cometchat-message-composer, cometchat-message-header |
| Init | CometChatUIKit.init(uiKitSettings) then CometChatUIKit.login("UID") |
| Purpose | Launch a direct 1:1 chat from a group member profile |
| Sample app | GitHub |
| Related | All Guides |
Components
| Component / Selector | Role |
|---|---|
cometchat-group-members | Displays group members with click handlers for private messaging |
cometchat-message-header | Header showing private chat information |
cometchat-message-list | Displays private conversation messages |
cometchat-message-composer | Input component for composing private messages |
Implementation Steps
1. Group Member Click Handler
When a group member is clicked, cast them to aUser object and initiate a private chat. Save the current group so the user can return to it later.
2. Group Members with Private Messaging Option
Rendercometchat-group-members and handle the (itemClick) output to trigger the private chat flow.
3. Private Chat Interface
Render a full chat view (header, message list, composer) for the 1:1 conversation. The header includes a back button that returns the user to the original group.4. Return to Group
When the user clicks back, restore the previous group context and close the private chat view.5. Full Component Example
A complete standalone component wiring group members, private chat, and navigation together.Feature Matrix
| Feature | Component / Method | Description |
|---|---|---|
| Group member selection | cometchat-group-members with (itemClick) | Triggers private chat from member list |
| Private chat initiation | startPrivateChat() | Saves group context and opens 1:1 chat |
| Private chat interface | cometchat-message-header, cometchat-message-list, cometchat-message-composer | Full 1:1 chat view with [user] binding |
| Context preservation | previousGroup property | Stores the group to return to |
| Return to group | returnToGroup() | Restores group context and closes private chat |
| Cleanup | ngOnDestroy | Clears private chat state on component destroy |
Next Steps
Group Members
Display and manage group member lists.
Message List
Render real-time message threads.
All Guides
Browse all feature and formatter guides.
Sample App
Full working sample application on GitHub.