{"library":"node-weixin-auth","title":"node-weixin-auth","description":"WeChat server authentication module for node-weixin-api and node-weixin-express. Version 0.6.3 provides token acquisition, automatic token refresh with configurable GAP, server IP retrieval, and message signature verification. It is part of the node-weixin ecosystem and requires node-weixin-settings for configuration persistence. Compared to other WeChat SDKs, it offers manual and automatic tokenization with a time gap to reduce expiration failures. The package has a moderate release cadence and is primarily used in Chinese development communities.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install node-weixin-auth"],"cli":null},"imports":["import nodeWeixinAuth from 'node-weixin-auth'","nodeWeixinAuth.tokenize(settings, app, callback)","nodeWeixinAuth.determine(settings, app, function) { ... })"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const nodeWeixinAuth = require('node-weixin-auth');\nconst settings = require('node-weixin-settings');\n\nconst app = {\n  id: process.env.WECHAT_APP_ID || '',\n  secret: process.env.WECHAT_APP_SECRET || '',\n  token: process.env.WECHAT_TOKEN || ''\n};\n\n// Optional: set time gap for token refresh\nnodeWeixinAuth.TIME_GAP = 60;\n\n// Manually get access token\nnodeWeixinAuth.tokenize(settings, app, (error, json) => {\n  if (!error) {\n    console.log('Access Token:', json.access_token);\n  }\n});\n\n// Automatically handle token for subsequent requests\nnodeWeixinAuth.determine(settings, app, () => {\n  console.log('Token is ready. You can now make API calls.');\n});","lang":"typescript","description":"Initializes WeChat auth with app credentials, manually fetches a token, and sets up automatic token refresh.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}