open im sdk for web
npm install @inter-digital/wasm-client-sdkUse this SDK to add instant messaging capabilities to your application. By connecting to a self-hosted OpenIM server, you can quickly integrate instant messaging capabilities into your app with just a few lines of code.
The underlying SDK core is implemented in OpenIM SDK Core. Using the WebAssembly support provided by Go language, it can be compiled into wasm for web integration. The web interacts with the OpenIM SDK Core through JSON, and the SDK exposes a re-encapsulated API for easy usage. In terms of data storage, JavaScript handles the logic of the SQL layer by virtualizing SQLite and storing it in IndexedDB using sql.js.
Visit https://docs.openim.io/ for detailed documentation and guides.
For the SDK reference, see https://docs.openim.io/sdks/quickstart/browser.
``shell`
npm install @openim/wasm-client-sdk --save
Follow these steps to obtain the static resources required for WebAssembly (WASM):
1. Locate the @openim/wasm-client-sdk subdirectory in the node_modules directory of your project. Copy all the files in the assets folder to your project's public resource directory.
The files to be copied are:
- openIM.wasmsql-wasm.wasm
- wasm_exec.js
-
2. After copying the files, import the wasm_exec.js file in your index.html file using a