Browse SDKs · Mini Program
Platform
SDKsMini Program

OpenIM Mini Program SDK overview

Understand Mini Program SDK use cases, runtime differences, and unavailable local search and clearing APIs.

Copy

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.

Unavailable APIs (Compared to WASM SDK)

The Mini Program SDK currently omits the following methods. You can implement full-text search and conversation history purging on your business backend, or page through available query endpoints and filter records in-memory.

Unavailable APIWASM ReferenceRecommended Alternative
clearConversationAndDeleteAllMsgClear conversation messagesManage history purging via backend policies or custom APIs; update the local UI view accordingly.
searchLocalMessagesSearch messagesSearch via backend search indexes, then locate the conversation by returned conversationID and clientMsgID.
searchFriendsSearch friendsFetch friends via paginated queries and filter locally, or query your organizational directory service.
searchGroupMembersSearch group membersUse Get group member list to filter locally, or search via backend services.
searchGroupsSearch groupsPage through joined groups and filter in-memory, or implement backend group discovery.
findMessageListFind messages by IDCache message IDs in session state, then fetch surrounding conversation context using available message query APIs.

Core Shared Capabilities (Refer to WASM SDK)

Runtime Considerations

  • Configure authorized domain allowlists (covering HTTP request, WebSocket connection, and file upload endpoints) in the Mini Program developer console before deployment.
  • Since the SDK is optimized for environments without a local database, your application does not need to handle local offline storage. When the Mini Program resumes or a view is restored, fetch the latest conversation and message snapshots on demand.
  • When sending file or media messages, adapt to the target platform's file pickers, temporary file path conventions, and package size limitations.
  • Authentication tokens must be securely issued by your application backend and strictly match the provided userID.
  • In standard web browsers, this pure JavaScript SDK is recommended only for lightweight widgets or temporary customer service chats. For production-grade web messaging applications requiring offline persistence and local caching, use the WASM SDK instead.