# nemeeting-core-sdk

> NEMeetingKit

Latest version **4.7.0** (published 2024-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install nemeeting-core-sdk
pnpm add nemeeting-core-sdk
yarn add nemeeting-core-sdk
bun add nemeeting-core-sdk
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.7.0 |
| Published | 2024-07-24 |
| First published | 2024-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 35 |
| Unpacked size | 4.2 MB |
| Known vulnerabilities | 0 (+27 in 4 direct dependencies) |
| Install scripts | no |
| Author | netease |
| Maintainers | netease-yunxin |

## Links

- npm: https://www.npmjs.com/package/nemeeting-core-sdk
- npm.io page: https://npm.io/package/nemeeting-core-sdk

## Dependencies (35)

- [qs](https://npm.io/package/qs.md) ^6.12.1
- [zod](https://npm.io/package/zod.md) ^3.23.8
- [antd](https://npm.io/package/antd.md) ^5.18.0
- [axios](https://npm.io/package/axios.md) ^0.27.2
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.11
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [react](https://npm.io/package/react.md) ^18.3.1
- [ahooks](https://npm.io/package/ahooks.md) ^3.7.8
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [swiper](https://npm.io/package/swiper.md) ^8.3.1
- [ts-md5](https://npm.io/package/ts-md5.md) ^1.2.11
- [i18next](https://npm.io/package/i18next.md) ^22.4.15
- [@antv/g2](https://npm.io/package/@antv/g2.md) ^5.1.16
- [cropperjs](https://npm.io/package/cropperjs.md) ^1.6.2
- [react-dom](https://npm.io/package/react-dom.md) ^18.3.1
- [react-rnd](https://npm.io/package/react-rnd.md) ^10.4.11
- [classnames](https://npm.io/package/classnames.md) ^2.5.1
- [lottie-web](https://npm.io/package/lottie-web.md) ^5.11.0
- [yuv-canvas](https://npm.io/package/yuv-canvas.md) ^1.2.11
- [antd-mobile](https://npm.io/package/antd-mobile.md) ^5.18.0
- [postcss-url](https://npm.io/package/postcss-url.md) ^10.1.3
- [@emotion/css](https://npm.io/package/@emotion/css.md) ^11.11.2
- [neroom-types](https://npm.io/package/neroom-types.md) ^1.30.0
- [re-resizable](https://npm.io/package/re-resizable.md) ^6.9.11
- [eventemitter3](https://npm.io/package/eventemitter3.md) ^4.0.7
- [react-cropper](https://npm.io/package/react-cropper.md) ^2.3.3
- [react-i18next](https://npm.io/package/react-i18next.md) ^12.2.2
- [@xkit-yx/utils](https://npm.io/package/@xkit-yx/utils.md) ^0.5.6
- [react-resizable](https://npm.io/package/react-resizable.md) ^3.0.5
- [@ant-design/icons](https://npm.io/package/@ant-design/icons.md) ^5.3.7
- [react-grid-layout](https://npm.io/package/react-grid-layout.md) ^1.4.4
- [react-virtualized](https://npm.io/package/react-virtualized.md) ^9.22.5
- [react-sortable-hoc](https://npm.io/package/react-sortable-hoc.md) ^2.0.0
- [react-string-replace](https://npm.io/package/react-string-replace.md) ^1.1.1
- [@netease-yunxin/log-storage](https://npm.io/package/@netease-yunxin/log-storage.md) ^1.0.5

## Recent versions

- 4.7.0 (latest) — 2024-07-24

## README

# NEMeetingKit

NEMeetingKit

## 下载依赖

```bash
$ npm install nemeeting-web-sdk --save
```

## 使用

```html
<!-- 预留一个dom用于挂载会议组件 -->
<div id="ne-web-meeting"></div>
```

```js
import NEMeetingKit from 'nemeeting-web-sdk'

/* 初始化
 * 需要一个id为ne-web-meeting的元素容器用于挂载会议组件
 * @param width：宽度(px)，为0则表示100%
 * @param height：高度(px)，为0则表示100%
 * @param config：入会配置
 * @param callback： 回调
*/
const config = {
    appKey: '', //云信服务appkey
}
NEMeetingKit.actions.init(0, 0, config, () => {
    console.log('init回调 ', e)

    // 检测浏览器兼容性
    NEMeetingKit.actions.checkSystemRequirements(
        function (err, result) {
            let str = ''
            if (err) {
                str = err
            } else {
                str = result ? "支持" : "不支持"
            }
            console.log('浏览器兼容性检测结果：', str)
        }
    )

    // 事件监听
    NEMeetingKit.actions.on("peerJoin", (members) => {
        console.log("成员加入回调", members);
    });
    NEMeetingKit.actions.on("peerLeave", (uuids) => {
        console.log("成员离开回调", uuids);
    });
    NEMeetingKit.actions.on("roomEnded", (reason) => {
        console.log("房间被关闭", reason);
    });

    NEMeetingKit.actions.addMeetingStatusListener({
      onMeetingStatusChanged: (status: NEMeetingStatus, arg, obj) => {
        console.log('会议状态变更了: ', status, arg, obj)
      },
    })

    // 获取会议相关信息
    const NEMeetingInfo = NEMeetingKit.actions.NEMeetingInfo // 会议基本信息
    const memberInfo = NEMeetingKit.actions.memberInfo // 当前成员信息
    const joinMemberInfo = NEMeetingKit.actions.joinMemberInfo // 入会成员信息

})

// token登录
NEMeetingKit.actions.login({
        accountId: accountId, // 账号
        accountToken: accountToken, // token
    },
    function (e) {
        console.log('login回调', e)
    }
);

// 登出
NEMeetingKit.actions.logout(
    function (e) {
        console.log('logout回调', e)
    }
)

// 加入会议，需要先进行token登录
NEMeetingKit.actions.join({
        meetingId: meetingId, // 会议号
        nickName: nickName, // 会中昵称
        video: 1, // 视频开关，1为打开2为关闭
        audio: 1, // 音频开关，1为打开2为关闭
    },
    function (e) {
        console.log('加入会议回调', e);
    }
);

// 取消监听
NEMeetingKit.actions.off("peerJoin")
NEMeetingKit.actions.off("peerLeave"）
NEMeetingKit.actions.off("roomEnded"）
NEMeetingKit.actions.removeMeetingStatusListener()

// 销毁sdk
NEMeetingKit.actions.destroy(); // 销毁
```

---
_Source: https://npm.io/package/nemeeting-core-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
