@knocklabs/node 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/package.json +4 -1
- package/dist/src/knock.js +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -136,6 +136,38 @@ await knockClient.users.setChannelData("jhammond", KNOCK_APNS_CHANNEL_ID, {
|
|
|
136
136
|
await knockClient.users.getChannelData("jhammond", KNOCK_APNS_CHANNEL_ID);
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
+
### Slack
|
|
140
|
+
|
|
141
|
+
```javascript
|
|
142
|
+
const { Knock } = require("@knocklabs/node");
|
|
143
|
+
const knockClient = new Knock("sk_12345");
|
|
144
|
+
|
|
145
|
+
const tenantId = "tenant-123";
|
|
146
|
+
const knockSlackChannelId = "7c1e0042-5ef2-411a-a43b-e541acb139ed";
|
|
147
|
+
// An optional object containing the query options passed to Slack:
|
|
148
|
+
// https://api.slack.com/methods/conversations.list#arg_cursor
|
|
149
|
+
const queryOptions = {
|
|
150
|
+
cursor: null,
|
|
151
|
+
limit: 200,
|
|
152
|
+
exclude_archived: true,
|
|
153
|
+
team_id: null,
|
|
154
|
+
types: "public_channel",
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
// Retrieve a list of Slack channels
|
|
159
|
+
const channelsInput = { tenant: tenantId, knockChannelId: knockSlackChannelId, queryOptions };
|
|
160
|
+
await knockClient.slack.getChannels(channelsInput);
|
|
161
|
+
|
|
162
|
+
// Check Slack connection
|
|
163
|
+
const authInput = { tenant: tenantId, knockChannelId: knockSlackChannelId }
|
|
164
|
+
await knockClient.slack.authCheck(authInput)
|
|
165
|
+
|
|
166
|
+
// Revoke access token
|
|
167
|
+
const revokeInput = { tenant: tenantId, knockChannelId: knockSlackChannelId }
|
|
168
|
+
await knockClient.slack.revokeAccessToken(revokeInput)
|
|
169
|
+
```
|
|
170
|
+
|
|
139
171
|
### Signing JWTs
|
|
140
172
|
|
|
141
173
|
When using [enhanced security mode](https://docs.knock.app/client-integration/authenticating-users) (recommended in production), you will need to sign JWTs server-side to authenticate your users.
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knocklabs/node",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "Library for interacting with the Knock API",
|
|
5
5
|
"homepage": "https://github.com/knocklabs/knock-node",
|
|
6
6
|
"author": "@knocklabs",
|
|
@@ -41,5 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"jose": "^5.2.0"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=17.5.0"
|
|
44
47
|
}
|
|
45
48
|
}
|
package/dist/src/knock.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knocklabs/node",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "Library for interacting with the Knock API",
|
|
5
5
|
"homepage": "https://github.com/knocklabs/knock-node",
|
|
6
6
|
"author": "@knocklabs",
|
|
@@ -41,5 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"jose": "^5.2.0"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=17.5.0"
|
|
44
47
|
}
|
|
45
48
|
}
|