Browse SDKs · WASM
Platform
SDKsWASM

Create an emoji message

Create an emoji message with the WASM SDK.

Copy

Use an emoji message for an entry in an application-defined emoji pack. The SDK neither downloads emoji assets nor interprets the application protocol, so sending and receiving clients must agree on the meaning of the index and extension data.

const { data: message } = await openimsdk.createFaceMessage({
  index: 12,
  data: JSON.stringify({ pack: 'default' }),
});

index is the agreed emoji index. data is the complete extension string and can contain the emoji-pack identifier, version, and other required metadata. If the receiver does not recognize the pack or index, provide a placeholder image or text.

When the Promise resolves, data is a pending MessageItem. Creating it neither uploads emoji assets nor sends the message. Next, use sendMessage() as described in Send a message.