SDKsWASM
Search conversations
Search local conversations by conversation name with the WASM SDK.
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. This is a local snapshot, and the query itself does not trigger events. To keep visible search results current, merge the conversation events owned by Retrieve the conversation list by conversationID.
Was this page helpful?