wechat-component-service

1.0.1 • Public • Published

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

/wechat-component-service/

    Package Sidebar

    Install

    npm i wechat-component-service

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • loulin