Skip to main content
This guide covers the full group lifecycle: creating groups, joining them, managing members, changing roles, and transferring ownership. Before starting, complete the Integration Guide.

Components

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.

Implementation Steps

1. Create Group

Build a component that collects a group name, type, and optional password. On submit, generate a unique GUID, call CometChat.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, emit ccGroupMemberJoined 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 using cometchat-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.
Let admins select users and add them to the group.
When you add members with a raw SDK call, emit the 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.
Display banned members and provide unban functionality for group admins.

6. Change Member Scope

Promote or demote a member by calling CometChat.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.
Let the current owner select a member and transfer ownership.

Feature Matrix


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.