@liuhlightning/wx-jssdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

wx-jssdk

Interface to wx jssdk

According to Low Coupling and High cohesion, using as less dependencies as possibel.

Has no side effect feature, such as storage.

How to use

Add script tag in html head

<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>

Import wx and config

import { wx } from "@liuhlightning/wx-jssdk"; 

wx.config({
  debug: import.meta.env.DEV,
  appId: "your app id",
  timestamp: "time when sign",
  nonceStr: "nonce when sign",
  signature: "signature",
  jsApiList: ["updateAppMessageShareData", "updateTimelineShareData"],
});

Package Sidebar

Install

npm i @liuhlightning/wx-jssdk

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

42.2 kB

Total Files

7

Last publish

Collaborators

  • liuhlightning