SDKsWASM
Invite users to a group
Invite one or more users to join a specified group.
Group owners and administrators can manage group members within the permissions granted by OpenIMServer. The client can use GroupMemberRole to control which actions are shown, but the server always performs the final authorization check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | string | Yes | ID of the target group. |
reason | string | Yes | Invitation note. Pass an empty string if no note is needed. |
userIDList | string[] | Yes | IDs of the users to invite. |
await openimsdk.inviteUserToGroup({
groupID,
reason: 'Invitation to join the project discussion group',
userIDList: ['user-002', 'user-003'],
});When the Promise resolves, the server has accepted the invitation request; it does not mean that every invited user is already present in the member list. If approval is required, an application event may occur first. Merge a user into the member list only after the user actually joins and OnGroupMemberAdded arrives. For the complete member event implementation, see List group members.
Was this page helpful?