1.0.1 • Published 6 years ago

wechat-component-service v1.0.1

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

wechat-component-service

Basic Usage

const ComponentService = require('wechat-component-service');

const service = new ComponentService({
  appid: '<WECHAT_COMPONENT_APPID>',
  token: '<WECHAT_COMPONENT_TOKEN>',
  appsecret: '<WECHAT_COMPONENT_APPSECRET>',
}, {
  // optional, default redis options for cache manager & redlock (in fact ioredis)
  client: { host: 'locahost', port: '6379', },
});

const component = service.getComponent(); // wechat component instance
const api = service.api(authorizerAppid); // wechat-api wrapper
const oauth = service.oauth(authorizerAppid); // wechat-oauth wrapper
const strategy = service.oauth(authorizerAppid); // passport-wechat wrapper