SDKsWASM
Create a contact card message
Create a user contact card message with the WASM SDK.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
userID | string | Yes | User ID represented by the contact card. |
nickname | string | Yes | Display name stored in the card. |
faceURL | string | Yes | Avatar URL stored in the card. |
ex | string | Yes | Complete 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 profile in the card is a snapshot taken at creation time and does not update automatically when the user's profile changes.
Was this page helpful?