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

1.4.7 • Public • Published

tencent-wx-jssdk

Weixin JS-SDK

This is lib not maintain anymore, please use [@types/jweixin](https://www.npmjs.com/package/@types/jweixin) instead.

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!

Dependents (1)

Package Sidebar

Install

npm i tencent-wx-jssdk

Weekly Downloads

3

Version

1.4.7

License

MIT

Unpacked Size

125 kB

Total Files

9

Last publish

Collaborators

  • taoqf