0.0.1 • Published 6 years ago

yunxinim v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

YunxinIM

网易云信IM模块的node.js SDK

Installation

npm install yunxinim

Usage

const IM = require('yunxinim');
const im = new IM(appKey,appSecret);

1. 获取鉴权Header

await im.getAuthHeaders({
    nonce: 随机数,// optional
    curTime: 当前时间戳,// optional
})

/** return:
{
            AppKey: this.appKey,
            Nonce: nonce,
            CurTime: `${curTime}`,
            CheckSum: checkSum,
        }
**/

2. 验证服务器推送过来的消息

const isLegal = await im.verifyPushMessage({
    md5: // header中的Md5
    checkSum: // header中
    curTime: // header中
    bodyStr: // 请求体string
})
0.0.1

6 years ago