Group overview
Understand group profiles, members, applications, roles, and events in the WASM SDK.
OpenIMSDK uses groups to hold shared profiles, membership, and permissions for multi-user chats. Use groupID to specify the group when sending group messages, reading group profiles, managing members, or processing join applications. A group conversation in the current user's chat list is specified by conversationID; do not interchange the two.
Core data types
| Type | Purpose |
|---|---|
GroupItem | Group name, avatar, announcement, owner, verification settings, member count, and extension data. |
GroupMemberItem | A user's in-group nickname, role, mute state, and join information. |
GroupApplicationItem | A group application and its processing state. |
Group member roles use GroupMemberRole: member is 20, administrator is 60, and owner is 100. The client can use these values to control which actions are shown, but OpenIMServer performs the final permission check.
Find pages by task
| Task | Pages |
|---|---|
| Create and maintain group profiles | Create a group, Update the group name, introduction, and avatar, Publish or update a group announcement, Set group extension data |
| Configure join and member permissions | Set group join verification, Set member profile access, Set in-group friend request permission |
| Join, leave, or dismiss groups | Join a group, Leave a group, Dismiss a group |
| Get joined groups or selected group profiles | Get joined groups by page, Get group information, Search joined groups |
| Get and process group applications | Get received group applications, Get sent group applications |
| Get and manage group members | Get group members, Invite users to a group, Remove group members, Manage group administrators, Transfer group ownership |
| Manage speaking permissions | Set group mute status, Mute or unmute a group member |
State updates
This page provides the complete listeners for group profile changes, the current user joining or leaving, and group dismissal:
import { SdkEvent } from '@openim/wasm-client-sdk';
const handlers = {
joinedAdded: ({ data }) => mergeJoinedGroup(data),
joinedDeleted: ({ data }) => removeJoinedGroup(data.groupID),
groupChanged: ({ data }) => mergeGroup(data),
groupDismissed: ({ data }) => markGroupDismissed(data.groupID),
};
openimsdk.on(SdkEvent.OnJoinedGroupAdded, handlers.joinedAdded);
openimsdk.on(SdkEvent.OnJoinedGroupDeleted, handlers.joinedDeleted);
openimsdk.on(SdkEvent.OnGroupInfoChanged, handlers.groupChanged);
openimsdk.on(SdkEvent.OnGroupDismissed, handlers.groupDismissed);
function removeGroupListeners() {
openimsdk.off(SdkEvent.OnJoinedGroupAdded, handlers.joinedAdded);
openimsdk.off(SdkEvent.OnJoinedGroupDeleted, handlers.joinedDeleted);
openimsdk.off(SdkEvent.OnGroupInfoChanged, handlers.groupChanged);
openimsdk.off(SdkEvent.OnGroupDismissed, handlers.groupDismissed);
}For all four events, use groupID to find and update the matching group, and avoid adding the same record twice. Promise completion, event delivery, and a later query returning the latest data are separate stages. If an add or delete event arrives during pagination, reset pagination and reload from the first page.
See List group members for the complete member-event listeners and Get received group applications for the complete application-event listeners.
WASM SDK group APIs cover only OpenIM group profiles, membership, and permissions. Public discovery, complex directories, and capacity governance for large group chats belong to the application backend and OpenIMServer configuration; do not document them as nonexistent client group types.
Was this page helpful?