AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Package | @cometchat/chat-uikit-angular |
| Key components | cometchat-groups, cometchat-group-members |
| Init | CometChatUIKit.init(uiKitSettings) then CometChatUIKit.login("UID") |
| Features | Create public/private/password-protected groups, manage members, roles, ownership transfer |
| Sample app | GitHub |
| Related | All Guides |
Components
| Component / Selector | Role |
|---|---|
cometchat-groups | Displays and manages group lists |
cometchat-group-members | Displays and manages group member lists |
The components below (
cometchat-create-group, cometchat-add-members, cometchat-banned-members, cometchat-transfer-ownership) are provided in the sample app, not in the @cometchat/chat-uikit-angular package. Use them as reference implementations or build your own using the CometChat SDK methods shown in this guide.| Sample App Component | Role |
|---|---|
cometchat-create-group | Creates new groups with different types and settings |
cometchat-add-members | Adds new members to existing groups |
cometchat-banned-members | Manages banned members and unban operations |
cometchat-transfer-ownership | Transfers group ownership to other members |
Implementation Steps
1. Create Group
Build a component that collects a group name, type, and optional password. On submit, generate a unique GUID, callCometChat.createGroup(), and emit the event so the rest of the UI updates.
2. Join Group
Handle joining for both public and password-protected groups. On success, emitccGroupMemberJoined to update the member list across the app.
Private groups cannot be joined with
joinGroup. They require an invitation or an admin to add the member.3. View Group Members
Render the member list for a group usingcometchat-group-members. Pass (itemClick) to handle member selection.
4. Add Members
cometchat-add-members is a sample-app reference component driven by ChatStateService.activeGroup. It has no [group] input and no (addMembersClick) output — it reads the active group from the state service. Use CometChat.addMembersToGroup() to build your own add-members UI.ccGroupMemberAdded UI Kit event so the rest of the UI stays in sync. Raw SDK calls alone will not produce UI Kit action-message synchronization.
5. Ban Members
cometchat-banned-members is a sample-app component. Use CometChat.banGroupMember() and CometChat.unbanGroupMember() to build your own banned-members UI.6. Change Member Scope
Promote or demote a member by callingCometChat.updateGroupMemberScope(). Emit ccGroupMemberScopeChanged so the UI reflects the role change.
The
ccGroupMemberScopeChanged payload uses the Angular UI Kit event shape { message, updatedUser, scopeChangedTo, scopeChangedFrom, group }. The message is the group action message for the scope change, and the actor is read from the message via message.getActionBy() — there is no top-level changedBy field.7. Transfer Ownership
cometchat-transfer-ownership is a sample-app reference component driven by ChatStateService.activeGroup. It exposes only a (closeClick) output — there is no [group] input or (transferOwnershipClick) output. Use CometChat.transferGroupOwnership() to build your own transfer-ownership UI.Feature Matrix
| Feature | Component / Method | Description |
|---|---|---|
| Create group | CometChat.createGroup() | SDK method for creating public/private/password groups |
| Join group | CometChat.joinGroup() | Joins public or password-protected groups |
| View members | cometchat-group-members | Displays member list with role indicators |
| Add members | CometChat.addMembersToGroup() | SDK method for batch adding members |
| Ban members | CometChat.banGroupMember() | SDK method for banning group members |
| Change scope | CometChat.updateGroupMemberScope() | Promote/demote member roles |
| Transfer ownership | CometChat.transferGroupOwnership() | Transfer owner role to another member |
| Group events | CometChatGroupEvents | RxJS subjects for group lifecycle events |
Next Steps
Groups
Display and manage group lists.
Group Members
Display and manage group member lists.
All Guides
Browse all feature and formatter guides.
Sample App
Full working sample application on GitHub.