1.1.1 • Published 6 years ago

weixin-auth v1.1.1

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

Build Status Coverage

weixin-auth

Wechat Authorization

Install

$ npm install weixin-auth

Usage

import {WechatMP, mock} from 'weixin-auth'

const mp = new WechatMP({
  appId: '<wechat mini-program appid>',
  secret: '<wechat mini-program secret>'
})

await mp.auth(code)
// {
//   openid: ...,
//   unionid: ...,
//   session_key: ...
// }

// We can mock the result for debugging purpose
mock({
  openid: 'a',
  unionid: 'b',
  session_key: 'c'
})

await mp.auth(code)
// {
//   openid: 'a',
//   unionid: 'b',
//   session_key: 'c'
// }

License

MIT

1.1.1

6 years ago

1.1.0

6 years ago

0.0.1-security

6 years ago

1.0.1

6 years ago

0.0.0

6 years ago