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 returns a pending MessageItem object. Note that the nickname and avatar stored in the contact card are snapshot values captured at creation time; if the user updates their profile later, the card does not update automatically. Next, deliver the card message to the target conversation using Send a message.
Was this page helpful?