wechat-component-service
v1.0.1
Published
Wechat component service
Downloads
7
Maintainers
Readme
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