OpenIM Docs β’ OpenIM Server β’ openim-sdk-wasm β’ openim-sdk-electron β’ openim-sdk-core
OpenIM provides an open-source Instant Messaging (IM) SDK for developers, serving as an alternative solution to cloud services like Twilio and Sendbird. With OpenIM, developers can build secure and reliable IM applications similar to WeChat, Zoom, and Slack.
This repository is based on the open-source version of the OpenIM SDK, offering an Electron-based IM application. You can use this application as a reference implementation of the OpenIM SDK. It references both @openim/electron-client-sdk and @openim/wasm-client-sdk, which are the Electron and Web versions of the SDK, respectively. This enables the creation of both PC Web applications and desktop applications (Windows, macOS, Linux).
This repository adopts the GNU Affero General Public License v3 (AGPL-3.0) with additional terms. Commercial use is not permitted. For more details, please refer to here.
Before you start developing, please ensure that your system has the following software installed:
- Operating System: Windows 10 or above, macOS 10.15 or above
- Node.js: Version β₯ 18.12 (manual installation or via nvm)
- pnpm: Version 10.x. The repository pins pnpm 10.28.0 through the
packageManagerfield. - Git: For version control
You also need to have the latest version of the OpenIM Server deployed. After that, you can compile this project and connect it to your own server for testing.
This application supports the following browsers and operating system versions:
| Browser/OS | Version | Status |
|---|---|---|
| Chrome | 78 and above | β |
| Windows | Windows 10 and above | β |
| macOS | 10.15 and above | β |
| Linux | 20.04 and above | β |
- Chrome: It is recommended to use the latest version for the best experience.
- Operating System: Make sure your system meets the version requirements to avoid compatibility issues.
Follow these steps to set up your local development environment:
-
Clone the repository
git clone https://github.com/openimsdk/openim-electron-demo.git cd openim-electron-demo -
Enable the pinned pnpm version and install dependencies
corepack enable corepack prepare pnpm@10.28.0 --activate pnpm install --frozen-lockfile -
Modify the configuration
-
In the
.envfile:If you haven't changed the default server port, simply change
VITE_BASE_HOSTto your server IP. If you need to set up a domain and HTTPS access, please refer to nginx configuration, use the configuration at the bottom, and modifyVITE_BASE_DOMAINto your domain name.VITE_BASE_HOST=your-server-ip VITE_WS_URL=ws://$VITE_BASE_HOST:10001 VITE_API_URL=http://$VITE_BASE_HOST:10002 VITE_CHAT_URL=http://$VITE_BASE_HOST:10008 # VITE_BASE_DOMAIN=your-server-domain # VITE_WS_URL=wss://$VITE_BASE_DOMAIN/msg_gateway # VITE_API_URL=https://$VITE_BASE_DOMAIN/api # VITE_CHAT_URL=https://$VITE_BASE_DOMAIN/chat
-
-
Run
pnpm devto start the development server. Access http://localhost:5173 to view the result. By default, the Electron application will also start. -
Start developing and testing! π
| Command | Purpose |
|---|---|
pnpm dev |
Start Vite and the Electron app |
pnpm typecheck |
Run the complete TypeScript check |
pnpm lint |
Run ESLint against the source code |
pnpm build |
Build the Web and Electron processes |
pnpm e2e |
Run the Playwright end-to-end tests |
The open-source version supports one-to-one audio and video calls. You need to first deploy and configure the server. For multi-party audio/video calls or video conferencing, please contact us at contact@openim.io.
- To enable audio and video calls on the web, you can only debug locally (localhost) or deploy the application to an HTTPS site for use. This limitation is due to browser security policies.
This project allows separate builds for the Web application and the Electron application, but there are some differences in the build process.
- Run the following command to build the Web application:
pnpm build
- The build artifacts will be located in the
distdirectory.
The packaging command builds the application, detects the actual runtime dependencies from dist-electron, temporarily supplies electron-builder with a minimized package manifest, and always restores the development manifest afterward. No manual copying of package.json is required.
On the corresponding system, run one of the following commands:
For cross-compilation, it is only supported to build other system installers on macOS. On Windows or Linux, you can only build installers for the same system.
- macOS x64:
pnpm build:mac - macOS arm64:
pnpm build:mac-arm - Windows x64:
pnpm build:win - Linux x64:
pnpm build:linux - Linux arm64:
pnpm build:linux-arm - All supported targets:
pnpm build:all
Additional electron-builder arguments can be passed through the generic command, for example:
pnpm electron:build -- --dirThe build artifacts will be located in the release directory. CI validates the generated runtime manifest, creates a Linux x64 directory package, and starts the packaged application in a virtual display as a smoke test.
| Feature Module | Feature | Status |
|---|---|---|
| Account Features | Phone number registration \ Email registration \ Verification code login | β |
| View \ Edit personal information | β | |
| Multi-language settings | β | |
| Change password \ Forgot password | β | |
| Friend Features | Find \ Apply \ Search \ Add \ Delete friends | β |
| Accept \ Reject friend requests | β | |
| Friend notes | β | |
| Allow friend requests or not | β | |
| Friend list \ Friend data real-time syncing | β | |
| Blocklist | Restrict messages | β |
| Real-time syncing of blocklist | β | |
| Add \ Remove from blocklist | β | |
| Group Features | Create \ Dismiss groups | β |
| Apply to join \ Invite to join \ Leave group \ Remove members | β | |
| Group name / Avatar changes / Group data updates (notifications, real-time sync) | β | |
| Invite members to group | β | |
| Transfer group ownership | β | |
| Group owner or admin approve join requests | β | |
| Search group members | β | |
| Message Features | Offline messages | β |
| Roaming messages | β | |
| Multi-end messages | β | |
| Message history | β | |
| Message deletion | β | |
| Clear messages | β | |
| Copy messages | β | |
| Typing indicator in single chat | β | |
| Do Not Disturb for new messages | β | |
| Clear chat history | β | |
| New members can view group chat history | β | |
| New message reminders | β | |
| Text messages | β | |
| Image messages | β | |
| Video messages | β | |
| Emoji messages | β | |
| File messages | β | |
| Voice messages | β | |
| Contact card messages | β | |
| Location messages | β | |
| Custom messages | β | |
| Conversation | Pin conversation | β |
| Mark conversation as read | β | |
| Mute conversation | β | |
| REST API | Authentication management | β |
| User management | β | |
| Relationship chain management | β | |
| Group management | β | |
| Conversation management | β | |
| Message management | β | |
| Webhook | Group callbacks | β |
| Message callbacks | β | |
| Push callbacks | β | |
| Relationship callbacks | β | |
| User callbacks | β | |
| Capacity & Performance | 10,000 friends | β |
| 100,000-member supergroup | β | |
| Second-level syncing | β | |
| Cluster deployment | β | |
| Multi-device kick-out strategy | β | |
| Online Status | No mutual kick-out across all platforms | β |
| Each platform can only log in with one device | β | |
| PC, Mobile, Pad, Web, Mini Program each can log in with one device | β | |
| PC not mutually kicked, only one device total for other platforms | β | |
| Audio/Video Call | One-to-one audio and video calls | β |
| File Storage | Supports private Minio deployment | β |
| Supports public cloud services COS, OSS, Kodo, S3 | β | |
| Push | Real-time online message push | β |
| Offline message push, supports Getui, Firebase | β |
For more advanced features, audio/video calls, or video conferences, please contact us at contact@openim.io.
-
When publishing to the web, how to solve slow WASM loading?
Answer: Use gzip compression on the WASM file to significantly reduce the size. You can also leverage a CDN to accelerate loading.
-
CKEditorError: ckeditor-duplicated-modules
Answer: Do not mix npm or Yarn installations with this repository. Remove the stale
node_modulesdirectory and runpnpm install --frozen-lockfileso CKEditor uses the version and pnpm patch recorded inpnpm-lock.yaml.
- Use pnpm 10 for all dependency and script operations. Do not run npm or Yarn in this repository.
- Commit
pnpm-lock.yamlwheneverpackage.jsonchanges. CI and reproducible local installs should usepnpm install --frozen-lockfile. - Add or remove packages with
pnpm add,pnpm add -D, andpnpm remove; do not edit the lockfile manually. - Native install scripts are intentionally restricted through
pnpm.onlyBuiltDependencies. Review that allowlist when adding native dependencies.
