Browse SDKs · WASM
SDKsWASM

Clear messages in a conversation

Keep a conversation entry while clearing its messages with the WASM SDK.

Copy

When the product action means “Clear chat history,” call clearConversationAndDeleteAllMsg(). This operation keeps the conversation entry while clearing the current account's messages and message-summary state.

await openimsdk.clearConversationAndDeleteAllMsg(conversationID);

After the Promise succeeds, you can immediately clear the current message list. Then use SdkEvent.OnConversationChanged to update the latest message, summary, and unread state. If the event does not arrive, query the conversation again and use the latest result. See Get the conversation list for complete event handling.