
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@zhike/co-wechat-api
Advanced tools
微信公共平台API。
此项目 Fork 自原作者项目,原因是微信公众平台添加了一些新的接口,找其他包要考虑历史兼容性问题,于是决定在此包上扩展,由于仅针对内部使用,所以可能不够完善,将来也不会合回主项目
详细参见API文档
$ npm install co-wechat-api
var WechatAPI = require('co-wechat-api');
async function() {
var api = new WechatAPI(appid, appsecret);
var result = await api.updateRemark('open_id', 'remarked');
}
当多进程时,token需要全局维护,以下为保存token的接口:
var api = new API('appid', 'secret', async function () {
// 传入一个获取全局token的方法
var txt = await fs.readFile('access_token.txt', 'utf8');
return JSON.parse(txt);
}, async function (token) {
// 请将token存储到全局,跨进程、跨机器级别的全局,比如写到数据库、redis等
// 这样才能在cluster模式及多机情况下使用,以下为写入到文件的示例
await fs.writeFile('access_token.txt', JSON.stringify(token));
});
原始API文档请参见:消息接口指南。
The MIT license.
FAQs
微信公共平台Node库API,ES6版本
We found that @zhike/co-wechat-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.