
Service accounts can also allow for setup of an interactive menu, so that followers can easily navigate content. Provide a secure email address as this will be used to access the admin panel. WeChat Official Account application - Account type selection 2. The account type cannot be changed after creation.
#Nodejs wechat official account connection how to
Compared to a subscription account, the allowed posting frequency is lower, but the visibility is higher and features are more robust. How to set up WeChat Official account - WeChat Official Account platform 1. Once the updates are published, they will appear as push notifications in followers’ chat lists. Service accounts can publish up to 4 updates per month, and up to six articles each time. Service accounts are ideal for sales and ecommerce, offering access to nine advanced APIs that allow businesses to create additional apps and functions that deliver timely information to customers. WeChat service accounts are focused on customer service, API integrations, e-commerce, and customer management. Subscription accounts are ideal for media, influencers, and businesses that want to post content regularly. These updates will appear in the followers’ subscription folder, which they will see upon opening along with updates from other subscription accounts. Content can be published daily to subscribers, in batches of up to six articles. WeChat subscription accounts are like a daily news feed. file, db., the default store used internally is FileStore if you didn't pass any custom store.There are 2 main types of official accounts for customer engagement: And the answer is using Store.įor simplicity sake, Stores are just some persistent place to store your tokens, e.g. One question you may ask is "where did you store all the tokens and js tickets?" since wechat will limit the access for these information.
#Nodejs wechat official account connection code
See the Demo in the lib to see how to use cached oauth token without getting code from wechat server every time. The key parameter in getUserInfo is used as an unique key to store the oauth token, the default key is the openid in returned user profile if you didn't pass anything, if you only need openid, you can call getUserBaseInfo to get basic profile. customize share-on-chat info //sugar method for `wechatObj.callWechatApi('onMenuShareAppMessage', ) You can simply call wechat-jssdk api to handle this in your route when you click save button: EncodingAESKey: this is needed if you want your communication between wechat server to be encrypted, but we will leave that empty for simplicity for now.Token: your custom wechat token, anything you want, but should be equal to the wechatToken in the config below when you initialize the Wechat instance,.When you click save, wechat server will send a validation request to this url, the example code below will handle this verification, URL: URL is your route/address to handle all requests/validations from wechat server, e.g.

Now click on the 基本配置(basic configuration) menu on the left-bottom of the left navigation.Īnd you will need to input the information on the 服务器配置(server configuration) section(red square below): The JS接口安全域名 should be the same domain(here is the local ip, also should be on port 80) as your test page domain, to configure this in production/real account, go to 公众号设置(account configuration) menu just above the major 开发 menu: If you want to test with your personal account, you can go to the 开发者工具 menu(see the menu image below), and click on the 公众平台测试帐号(test account) to the test account configuration page to use your personal wechat account to test the functionality.

Featuresīefore you can use the jssdk, first you need to setup some basic configuration on Wechat Dashboard, login with your wechat account(usually you need a public or subscribe account, the personal account may not work). I will go through the features powered by this lib one by one to give you a better understanding for the apis, so that you can get start very quickly when you need to develop such features. Wechat-jssdk is a next generation lib with NodeJS integration by using ES6 features. Here I want to talk about by using the next-gen wechat-jssdk lib to leverage the Wechat JSSDK APIs for H5 or mobile pages that are used in wechat app with the ability to invoke wechat apis and even native apis exposed by wechat app.

Almost every company in China has a business or public/subscribe account on Wechat platform, which makes it much more important for web developers to make the best use of wechat and it's APIs. Wechat has been one of the most famous instant message apps in the world, but also a major zone for business for companies and organizations especially in China.
