OpenIM Mini Program SDK overview
Use WASM documentation as the shared API baseline and understand Mini Program runtime differences and unavailable local search and clearing APIs.
The OpenIM Mini Program SDK is designed for Mini Programs and lightweight Web scenarios. Its method-level models for users, conversations, messages, groups, and events are consistent with other OpenIMClientSDKs. However, it does not provide local message storage or several search and clearing APIs that depend on a local database. Follow the WASM SDK documentation for shared capabilities. This page covers only runtime differences and unavailable APIs.
Relationship to WASM
- Follow the corresponding WASM guide for method semantics, events, and data models.
- Differences are limited to the initialization entry point, domain allowlists, file selection and uploads, platform lifecycle, and the unavailable APIs listed below.
- A Web client that needs a complete local message database, conversation cache, and persistent history should use the WASM SDK instead.
APIs unavailable compared with WASM
The Mini Program SDK does not currently provide the following methods. Do not design a product around local full-text search or locally clearing conversation history. Use a business backend for search, or retrieve data with an available paginated query and filter it in the application.
| Unavailable API | WASM reference | Recommended alternative |
|---|---|---|
clearConversationAndDeleteAllMsg | Clear conversation messages | Handle history cleanup through server policy or a business API, then refresh only the current conversation view. |
searchLocalMessages | Search messages | Use a trusted backend message index, then open the result by conversationID and clientMsgID. |
searchFriends | Search friends | Retrieve friends by page and filter them in the application, or use business-directory search. |
searchGroupMembers | Search group members | Page through getGroupMemberList results and filter them, or use backend member search. |
searchGroups | Search groups | Page through joined groups and filter them, or use backend group discovery. |
findMessageList | Find messages by ID | Retain message IDs in server or conversation state, then load context through an available history query. |
Shared capabilities documented under WASM
| Domain | WASM entry point |
|---|---|
| Authentication | Authenticate and manage a session |
| Getting started | Integrate by runtime environment and Send your first message |
| Users | User overview |
| Conversations | Conversation overview |
| Groups | Group overview |
| Messages | Message overview |
| Events | Event overview |
Runtime considerations
- Before testing login, allow the required request, WebSocket, and upload domains in the target platform configuration.
- Do not make business logic depend on the SDK's local message database or local conversation persistence. Synchronize the required data again after restoring a page.
- Validate file messages against the target platform's file picker, temporary paths, upload APIs, and size limits.
- Continue to issue tokens from a trusted backend. The client should receive only short-lived credentials.
- When using the Mini Program SDK on the Web, limit it to lightweight scenarios. Use the WASM SDK for a full-featured Web IM client.
Was this page helpful?