This is a library to use wechat js api, including get accessToken, get jsTicket, using wx library.
For more details, please refer to wechat official doc.
meteor add huaming:wechat-js
First configure your WECHAT_APP_ID and WECHAT_APP_SECRET in process.env.
return a new access token from wechat api, ex. { access_token: ‘access_token’, expires_in:7200 }
return a new jsticket from wechat api, ex. { errorcode: ‘’, errmsg: ‘’, ticket: ‘ticket str’, expires_in: 7200 }
return a sha1 string by encrypting the splice string of the given parameters, for more details please refer to the official doc about the algorithm for generating signature
return a configure object for given url, ex. { appId: ‘app id’, timestamp: 12345678, nonceStr: ‘abcdef’, signature: ‘signature’, jsApiList: [] }
return a valid token. If the old one has expires, it will request a new one for you.
return a valid js ticket. If the old one has expires, it will request a new one for you.