Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

cycdpo/weixinjssdk

Repository files navigation

Weixin Jssdk

NPM version David deps devDependencies Status npm download npm license

This package has been deprecated

This package has been migrated to @cycjimmy/weixin-jssdk for scoped NPM package. Please switch to @cycjimmy/weixin-jssdk to stay up to date.

Install

# via npm
$ npm install weixinjssdk --save

# or via yarn
$ yarn add weixinjssdk

Use

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
  // ...
});

More

  • 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.