SDKsWASM
Create a Markdown message
Create a Markdown message with the WASM SDK.
Use a Markdown message for text that needs basic formatting. The argument is the complete Markdown source. Validate empty input, length, and allowed syntax according to the application's content rules before creating the message.
const { data: message } = await openimsdk.createMarkdownMessage(
'**Deployment complete**\n\n- Web\n- WASM',
);The SDK only stores and transports the content; it does not make rendering safe. The receiving client must use a securely configured renderer, filter untrusted HTML, links, and script protocols, and provide a plain-text presentation for clients that do not support Markdown.
When the Promise resolves, data is a pending MessageItem; it is not sent and no new-message event is triggered. Next, use Send a message to send the object.
Was this page helpful?