Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

for-wechat

zdpdpdp12Apache-2.01.0.0

wechat-api-sdk supported by nodejs

wechat, sdk

readme

wechat-api-sdk

let wechat = require("wechat");


/*
自定义token获取途径 如果不设置 就默认向微信获取
wechat.access_token.setTokenFun(function(){
    return "xxxxx"
});

*/
wechat.init({
    appid: "xxxxxxx",
    secret: "xxxxxxxxxx"
});

let official = wechat.officialAccount

let openid = "xxxxxx"
//获取用户信息 api
//official.user.get(openid).then...


// 客服消息api
//let p = official.staff.message("hello world").to(openid).send().then..



// 获取所有模板
//let p = official.template_message.templates().then...


let template_id = "xxxx"
//模板消息api
official.template_message.template(template_id)
.to(openid).andData({name:"zdp"}).send().then(function(res){
    console.log(res)
})