Client interface depend WeChat Core API, you need to create an instance of WeChat
const WeChat = require('wechat-lite');
const wx = new WeChat({
appId: 'wx-your-app-id'
});
wx.uuid().then(function(uuid){
console.log(uuid);
})
console.log(wx.qrcode(uuid));
(function wait(){
wx.status(uuid).then(function(status){
if(status.code == 200){
console.log(status.redirect_uri); //登录URL
}else{
wait();
}
});
})()
wx.login(url).then(function(info){
console.log(info); // login info
})
const client = new WeChat.Client(login);
client.init().then(function(){
// success
});
client.send('hi').then(function(){
// success
});