Browse SDKs · WASM
SDKsWASM

Create an @ message

Create a group-chat text message with @ mentions using the WASM SDK.

Copy

Parameters

ParameterTypeRequiredDescription
textstringYesMessage body. Stable markers such as @userID are recommended.
atUserIDListstring[]YesIDs of the mentioned users. Use the SDK's AtAllTag to mention everyone.
atUsersInfoAtUserInfo[]NoUser IDs and their display names within the group.
messageMessageItemNoOriginal message being referenced.
const { data: message } = await openimsdk.createTextAtMessage({
  text: '@user_a please confirm',
  atUserIDList: ['user_a'],
  atUsersInfo: [{ atUserID: 'user_a', groupNickname: 'Alex' }],
});

When the Promise resolves, it returns only a pending message object. This message can be sent only to a group chat. Creating it does not change the conversation's @ state or trigger a new-message event.