You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

tencent-wechat-jssdk

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tencent-wechat-jssdk

微信 JS-SDK

1.0.0-202003080048
latest
Source
npmnpm
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

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!

Keywords

wx

FAQs

Package last updated on 07 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts