cycdpo / weixinjssdk

weixin-jssdk for node.js

Home Page:https://www.npmjs.com/package/weixinjssdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

weixin-jssdk for node.js

https://www.npmjs.com/package/weixinjssdk

License:MIT License


Languages

Language:JavaScript 100.0%