Browse SDKs · WASM
SDKsWASM

Create a contact card message

Create a user contact card message with the WASM SDK.

Copy

Parameters

ParameterTypeRequiredDescription
userIDstringYesUser ID represented by the contact card.
nicknamestringYesDisplay name stored in the card.
faceURLstringYesAvatar URL stored in the card.
exstringYesComplete extension string for the card. Pass an empty string when no extension is needed.
const { data: message } = await openimsdk.createCardMessage({
  userID: 'user_b',
  nickname: 'Alex',
  faceURL: 'https://example.com/avatar.png',
  ex: '',
});

When the Promise resolves, it has created only a message object. The card stores the profile values supplied when the message was created and does not update automatically when the user's profile changes.