Browse SDKs · WASM
SDKsWASM

Create a forwarded message

Create a single-message forward with the WASM SDK.

Copy

A single-message forward creates a new pending object from one message that has already been sent successfully. Pass the complete original MessageItem; do not pass only its text or reconstruct its message element:

const { data: message } = await openimsdk.createForwardMessage(sourceMessage);

A message that is still sending or has failed cannot be forwarded. The application should also decide whether to show the forwarding action based on permissions, content expiration, and the availability of local files.

When the Promise resolves, data is a pending MessageItem with a new clientMsgID; the original message is unchanged. Next, use Send a message to send the new object to a one-to-one or group conversation. Creating the object does not trigger a new-message event.