Why do we need WeChat JS SDK?

David Yu
David Yu
Apr 14, 2018 · 3 min read

Well, maybe you don’t need to use it. Here are the list of benefits that WeChat JS SDK provides.

What is WeChat JSSDK?

WeChat JSSDK is a bridge between a website and WeChat native app. It allows a website to do more in WeChat.

Why do we need WeChat JS SDK?

As you might have already know, WeChat has its own special environment for development. Not only its within Chinese internet, it’s tightly control by its company, Tencent. Which means, we will have to play by its rule when doing development in WeChat.

Reason #1: Sharing customization

While there are some hacks to use meta tags to share from other browser to WeChat to get the customized sharing card. Its limitation is when sharing is happening within WeChat. WeChat JS SDK will let you define how your sharing card would look.

Here are the list of share related JS API:

onMenuShareTimeline — When user shares to “moment” in their WeChat

onMenuShareAppMessage — When user shares to friend or a chat group

onMenuShareQQ — When user shares to QQ

onMenuShareWeibo — When user shares to Weibo

onMenuShareQZone — When user shares to QZone.

As you might notice, all of the share destinations are Tencent companies.

Reason #2 Native WeChat App Access

Because WeChat is a native app, so it has access to user’s hardware. Microphone, camera, and GPS.

You could ask user to record a message, or scan a QR code, or using GPS to find the nearest store, etc.

What I think it’s cool is that it provides you a voice translation api, so it’s really helpful for foreign user, and it can potentially be used to do something cool.

Here is the list:

startRecord

stopRecord

onVoiceRecordEnd

playVoice

pauseVoice

stopVoice

onVoicePlayEnd

uploadVoice

downloadVoice

chooseImage

previewImage

uploadImage

downloadImage

translateVoice

getNetworkType

openLocation

getLocation

scanQRCode

Reason #3: Manage how the menu looks

Here are a list of menu options:

Expose: “menuItem:exposeArticle”

Set font: “menuItem:setFont”

Day Mode: “menuItem:dayMode”

Night Mode: “menuItem:nightMode”

Refresh: “menuItem:refresh”

View Official account (added): “menuItem:profile”

View Official account (not added): “menuItem:addContact”

Send to friends: “menuItem:share:appMessage”

Share to moments: “menuItem:share:timeline”

Share to QQ “menuItem:share:qq”

Share to Weibo: “menuItem:share:weiboApp”

Favorite: “menuItem:favorite”

Share to FB: “menuItem:share:facebook”

Share to QZone/menuItem:share:QZone

Edit tags: “menuItem:editTag”

Delete: “menuItem:delete”

Copy URL: “menuItem:copyUrl”

Original Page “menuItem:originPage”

Reading Mode: “menuItem:readMode”

Open with QQ Browser: “menuItem:openWithQQBrowser”

Open with Safari: “menuItem:openWithSafari”

Email: “menuItem:share:email”

Some special official account: “menuItem:share:brand”

Reason #4:Access to WeChat Pay and Cards

Although you would have to apply for it. WeChat pay and cards would be really useful for e-commerce. As mobile payment is already engrained in the user habit in China, WeChat also let you manage discount cards or royalty cards. If you want user to sign up for membership and drive more sales online, this will be helpful to look into.

Here are the list:

chooseWXPay

openProductSpecificView

addCard

chooseCard

openCard

If you don’t need any of these functions, you probably don’t need to spend time implementing Wechat JSSDK into your website.

Thanks for reading. Let me know what else you would like to know in the comment below.

WeChat official account platform:

https://mp.weixin.qq.com/?lang=en_US

WeChat JSSDK Document:

https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115

David Yu

Written by

David Yu

Software Freelancer based in Shanghai. More articles at https://shanghaicoders.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade