linkv-im
v1.0.6
Published
WebIM SDK
Downloads
5
Readme
WebIM SDK 参考文档
安装
- 通过
npm
包管理器安装并使用 WebIM SDK:
# 最新版本
npm i git+ssh://[email protected]:live.me_IM/webim.git --save
# 指定版本号
npm i git+ssh://[email protected]:live.me_IM/webim.git#1.0.2 --save
/// CommonJS
const { WebIM } = require("webim");
const messenger = new WebIM({ appId: "{Your appId}", appKey: "{Your AppKey}" });
/// ESM & TypeScript
import { WebIM } from "webim";
const messenger = new WebIM({ appId: "{Your appId}", appKey: "{Your AppKey}" });
- 通过
<script>
标签使用 WebIM SDK(其他对应版本的 SDK 文件可以在当前仓库dist/
目录下面找到):
<!DOCTYPE html>
<html>
...
<body>
<script src="https://cdn.xxx.com/webim-1.0.2.js"></script>
<script>
const { WebIM } = webim;
const messenger = new WebIM({ appId: "{Your appId}", appKey: "{Your AppKey}" });
</script>
</body>
</html>