{"id":13487611,"url":"https://github.com/eggjs-community/egg-wechat-api","last_synced_at":"2025-10-25T10:42:59.181Z","repository":{"id":57220896,"uuid":"97457169","full_name":"eggjs-community/egg-wechat-api","owner":"eggjs-community","description":"Wechat Api for Egg.js","archived":false,"fork":false,"pushed_at":"2018-07-09T02:52:09.000Z","size":31,"stargazers_count":71,"open_issues_count":0,"forks_count":6,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-11T19:04:58.290Z","etag":null,"topics":["egg-plugin","wechat-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eggjs-community.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-17T09:09:31.000Z","updated_at":"2022-01-02T06:26:08.000Z","dependencies_parsed_at":"2022-08-29T04:01:42.943Z","dependency_job_id":null,"html_url":"https://github.com/eggjs-community/egg-wechat-api","commit_stats":null,"previous_names":["thonatos/egg-wechat-api"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs-community%2Fegg-wechat-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs-community%2Fegg-wechat-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs-community%2Fegg-wechat-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggjs-community%2Fegg-wechat-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggjs-community","download_url":"https://codeload.github.com/eggjs-community/egg-wechat-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101547,"owners_count":22014909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egg-plugin","wechat-api"],"created_at":"2024-07-31T18:01:01.176Z","updated_at":"2025-10-25T10:42:54.137Z","avatar_url":"https://github.com/eggjs-community.png","language":"JavaScript","funding_links":[],"categories":["仓库"],"sub_categories":["插件"],"readme":"# egg-wechat-api\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/egg-wechat-api.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/egg-wechat-api\n[travis-image]: https://img.shields.io/travis/eggjs-community/egg-wechat-api.svg?style=flat-square\n[travis-url]: https://travis-ci.org/eggjs-community/egg-wechat-api\n[codecov-image]: https://img.shields.io/codecov/c/github/eggjs-community/egg-wechat-api.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/eggjs-community/egg-wechat-api?branch=master\n[david-image]: https://img.shields.io/david/eggjs-community/egg-wechat-api.svg?style=flat-square\n[david-url]: https://david-dm.org/eggjs-community/egg-wechat-api\n[snyk-image]: https://snyk.io/test/npm/egg-wechat-api/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/egg-wechat-api\n[download-image]: https://img.shields.io/npm/dm/egg-wechat-api.svg?style=flat-square\n[download-url]: https://npmjs.org/package/egg-wechat-api\n\n\u003c!--\nDescription here.\n--\u003e\n\negg plugin for [wechat-api](https://github.com/node-webot/co-wechat-api)\n\n## Install\n\n```bash\n$ npm i egg-wechat-api --save\n```\n\n## Prerequisite\n\nNode.js \u003e= 7.x\n\n## Usage\n\n- [co-wechat-api](https://github.com/node-webot/co-wechat-api)\n\n## Dependencies\n\n- egg\n\t- [egg-redis](https://github.com/eggjs/egg-redis)\n- other\n\t- [co-wechat-api](https://github.com/node-webot/co-wechat-api)\n\n## Configuration\n\n```js\n// {app_root}/config/plugin.js\nexports.wechatApi = {\n  enable: true,\n  package: 'egg-wechat-api',\n};\n```\n\u003e if redis is single client\n\n```js\n// {app_root}/config/config.default.js\nexports.wechatApi = {  \n  appId: '',\n  appSecret: '',\n};\n```\n\u003e if redis is multi clients\n\n```js\n// {app_root}/config/config.default.js\nexports.wechatApi = {\n  appId: '',\n  appSecret: '',\n  redisInstance: '', // select instance of redis\n};\n```\n\n\u003e __Redis is required !__\n\nsee [config/config.default.js](config/config.default.js) for more detail.\n\n## Example\n\n\u003c!-- example here --\u003e\n\n```\n'use strict';\n\nmodule.exports = app =\u003e {\n\n  app.get('/', function* () {\n\n    const { wechatApi } = app;\n\n    try {\n      const ticket = yield wechatApi.getTicket();\n      this.status = 200;\n      this.body = ticket;\n\n    } catch (error) {\n      this.status = 500;\n      this.body = error;\n    }\n  });\n\n};\n```\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/eggjs/egg/issues).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs-community%2Fegg-wechat-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggjs-community%2Fegg-wechat-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggjs-community%2Fegg-wechat-api/lists"}