You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -806,6 +790,31 @@ Before you can begin using these TypeScript definitions with your project, you n
806
790
* Set tsconfig.json: `{"compilerOptions": {"moduleResolution":"node"}, ...}`
807
791
* Includes the TypeScript definitions for node. You can use npm to install this by typing the following into a terminal window:
808
792
`npm install --save-dev @types/node`
793
+
794
+
### Typescript example
795
+
```
796
+
import*asmqttfrom"mqtt"
797
+
let client :mqtt.MqttClient=mqtt.connect('mqtt://test.mosquitto.org')
798
+
```
799
+
800
+
<a name="weapp-alipay"></a>
801
+
## WeChat and Ali Mini Program support
802
+
### WeChat Mini Program
803
+
Supports [WeChat Mini Program](https://mp.weixin.qq.com/). Use the `wxs` protocol. See [the WeChat docs](https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-socket.html).
804
+
805
+
```js
806
+
var mqtt =require('mqtt')
807
+
var client =mqtt.connect('wxs://test.mosquitto.org')
808
+
```
809
+
810
+
### Ali Mini Program
811
+
Supports [Ali Mini Program](https://open.alipay.com/channel/miniIndex.htm). Use the `alis` protocol. See [the Alipay docs](https://docs.alipay.com/mini/developer/getting-started).
812
+
<a name="example"></a>
813
+
814
+
```js
815
+
var mqtt =require('mqtt')
816
+
var client =mqtt.connect('alis://test.mosquitto.org')
817
+
```
809
818
810
819
<a name="contributing"></a>
811
820
## Contributing
@@ -827,6 +836,7 @@ MQTT.js is only possible due to the excellent work of the following contributors
0 commit comments