Browse SDKs · WASM
SDKsWASM

Search conversations

Search local conversations by conversation name with the WASM SDK.

Copy

searchConversation() performs a partial match against showName in the SDK's local conversation data. Use it for search within a conversation list. The search term must not be empty, and the method does not query the server for conversations that have not been synchronized locally.

const { data: conversations } = await openimsdk.searchConversation(searchKeyword.trim());

renderConversationResults(conversations);

When the Promise resolves, data contains the matching ConversationItem[], ordered by latestMsgSendTime from newest to oldest. The results reflect the conversation data stored locally at the time of the call, and the query itself does not trigger events. To keep visible search results current, listen for the conversation events described in Get the conversation list and update matching results by conversationID.