AI Integration Quick Reference
AI Integration Quick Reference
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, callCometChat.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. CallCometChat.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 usingCometChatGroupMembers. 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, callCometChat.addMembersToGroup(), and emit ccGroupMemberAdded so the member list refreshes.
File: CometChatAddMembers.tsx
5. Ban Members
Fetch the list of banned members usingBannedMembersRequestBuilder. 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 callingCometChat.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 viaCometChat.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.