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
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ yarn add mixin-node-sdk
18
18
```
19
19
20
20
## Usage
21
+
1. Use Mixin Api
21
22
```js
22
23
const {Client} =require('mixin-node-sdk')
23
24
constclient=newClient({
@@ -37,8 +38,28 @@ async function getMe() {
37
38
console.log(me)
38
39
}
39
40
```
41
+
2. Use Mixin's message
42
+
```js
43
+
const {BlazeClient} =require('mixin-node-sdk')
44
+
constclient=newBlazeClient({
45
+
"client_id":"",
46
+
"session_id":"",
47
+
"pin_token":"",
48
+
"private_key":"",
49
+
"pin":"",
50
+
"client_secret":""
51
+
}, {parse:true, syncAck:true})
52
+
53
+
client.loopBlaze({
54
+
onMessage(msg){
55
+
console.log(msg)
56
+
},
57
+
})
40
58
41
59
60
+
```
61
+
> BlazeClient directly inherits Client, so all Client methods BlazeClient can be called directly.
62
+
42
63
43
64
## Note
44
65
1. If you are using the version of `[email protected]`, please see [https://github.com/liuzemei/mixin-node-sdk](https://github.com/liuzemei/mixin-node-sdk)
0 commit comments