import { AXRobotManage, AppMode } from "@autoxing/robot-js-sdk";
const axRobot = new AXRobotManage(
{
tokenData: {
"token": token, // 登录token
"tokenTime": tokenTime, // 登录时间
"tokenKey": tokenKey, // 登录token的key
"expireTime": expireTime // token 过期时间
},
appId:appId, // 机器人管理平台根据权限获取appid
secret: appSecret, // 机器人管理平台根据权限获取appSecret
mode: AppMode.WAN_APP, // 应用模式:AppMode已在包内export,可直接引入
serverUrl: serverUrl, // 私有化serverUrl
wsUrl: wsUrl, // 私有化wsUrl
viewLanguage: getApp().globalData.language, // 语言 可不传
}
);
const success = await axRobot.init();
if (success) {
// 初始化成功
...
} else {
// 初始化失败
...
}