阿里云音视频通信dingRTC token 生成器,为加入频道生成复合规则的token。
You can install it as dependency with npm/cnpm or yarn.
$ # save into package.json dependencies with -S
$ npm install @dingrtc/token-generator -S
$ # you can use cnpm for fast install
$ cnpm install @dingrtc/token-generator -S
$ # use yarn for install
$ yarn add @dingrtc/token-generator
- 生成token
const { produce } = require('@dingrtc/token-generator');
/**
* 传递appId, channelId, userId, appKey
*/
const token = produce({
appId: 'xxxx',
channelId: 'xxxx',
userId: 'xxxx',
appKey: 'xxxx',
});
console.log(token)