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 Getting Started guide for your framework.

Components


Integration Steps

1. Create Group

Build a form that collects a group name, type (public/private/password), and optional password. On submit, generate a unique GUID, call CometChat.createGroup(), and emit ccGroupCreated so the rest of the UI updates. File: CometChatCreateGroup.tsx

2. Join Group

Handle joining for both public and password-protected groups. Call CometChat.joinGroup() with the group’s GUID, type, and password (if applicable). On success, emit ccGroupMemberJoined to update the member list across the app. File: CometChatJoinGroup.tsx

3. View Group Members

Render the member list for a group using CometChatGroupMembers. Pass onItemClick to handle member selection and options to add context-menu actions like “View Profile”. File: CometChatHome.tsx

4. Add Members

Let admins select users and add them to the group. Collect selected UIDs, call CometChat.addMembersToGroup(), and emit ccGroupMemberAdded so the member list refreshes. File: CometChatAddMembers.tsx

5. Ban Members

Fetch the list of banned members using BannedMembersRequestBuilder. This component displays banned users and provides unban functionality for group admins. File: CometChatBannedMembers.tsx

6. Change Member Scope

Promote or demote a member by calling CometChat.updateGroupMemberScope(). Pass the member’s UID, the new scope (admin, moderator, or participant), and the group GUID. Emit ccGroupMemberScopeChanged so the UI reflects the role change. File: CometChatHome.tsx

7. Transfer Ownership

Let the current owner select a member and transfer ownership via CometChat.transferGroupOwnership(). The group object is cloned and updated locally, then ccOwnershipChanged is emitted to sync the UI. File: CometChatTransferOwnership.tsx

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.