This package has been migrated to @cycjimmy/weixin-jssdk for scoped NPM package. Please switch to @cycjimmy/weixin-jssdk to stay up to date.
# via npm
$ npm install weixinjssdk --save
# or via yarn
$ yarn add weixinjssdk
const WxJssdk = require('weixinjssdk');
const wxJssdk = new WxJssdk()
.setWxConfig({
appid: 'your appid',
secret: 'your secret',
})
[.setHook({
getAccessTokenSuccess: new Promise...,
getAccessTokenFromCustom: new Promise...,
})];
wxJssdk.wxshare({
url: 'whole url'
})
.then(data => {
// Do something
// ...
});
wxJssdk.setHook
: [Object] Set Hook Functions.getAccessTokenSuccess
: [Promise] Run Hook when get Access_Token success. Please resolve Access_Token.getAccessTokenFromCustom
: [Promise] Run custom task Before get Access_Token from wechat. Please resolve Access_Token.