tencent-wechat-jssdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-202003080048 • Public • Published

tencent-wx-jssdk

Weixin JS-SDK

SDK Version

1.6.0

Install

npm install tencent-wechat-jssdk --save

How to Use

TypeScript

// sometime you want import this module, eg. use this with webpack
import { scanQRCode } from 'tencent-wx-jssdk';
 
scanQRCode({
    needResult: 0,
    scanType: ['qrCode'],
    success(res) {
        console.log(res);
    }
});

or, you could add this module in your tsconfig.json

{
    "compilerOptions": {
        "types": [
            "tencent-wx-jssdk"
        ]
    }
}

then use it freely.

 
jWeixin.scanQRCode({
    needResult: 0,
    scanType: ['qrCode'],
    success(res) {
        console.log(res);
    }
});
 
// sometimes you must use WeixinJSBridge, like wexin paying
WeixinJSBridge.invoke("getBrandWCPayRequest", {}, (res) => {
});

javascript

You will need this only if you would like get your project packed.

const wx = require('tencent-wx-jssdk');
wx.scanQRCode({
    needResult: 0,
    scanType: ['qrCode'],
    success(res) {
        console.log(res);
    }
});

Others

ts Error

If you get this Error: [ts] Initializers are not allowed in ambient contexts.

Try add "skipLibCheck": true to compilerOptions in file tsconfig.json.

Good luck!

Package Sidebar

Install

npm i tencent-wechat-jssdk

Weekly Downloads

2

Version

1.0.0-202003080048

License

MIT

Unpacked Size

50.2 kB

Total Files

10

Last publish

Collaborators

  • choukin