@chat-adapter/slack 4.0.0 → 4.0.2
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/LICENSE +9 -0
- package/README.md +76 -0
- package/package.json +11 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vercel, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# @chat-adapter/slack
|
|
2
|
+
|
|
3
|
+
Slack adapter for the [chat](https://github.com/vercel-labs/chat) SDK.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install chat @chat-adapter/slack
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Chat } from "chat";
|
|
15
|
+
import { createSlackAdapter } from "@chat-adapter/slack";
|
|
16
|
+
|
|
17
|
+
const chat = new Chat({
|
|
18
|
+
userName: "mybot",
|
|
19
|
+
adapters: {
|
|
20
|
+
slack: createSlackAdapter({
|
|
21
|
+
botToken: process.env.SLACK_BOT_TOKEN!,
|
|
22
|
+
signingSecret: process.env.SLACK_SIGNING_SECRET!,
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Handle @mentions
|
|
28
|
+
chat.onNewMention(async (thread, message) => {
|
|
29
|
+
await thread.post("Hello from Slack!");
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Configuration
|
|
34
|
+
|
|
35
|
+
| Option | Required | Description |
|
|
36
|
+
|--------|----------|-------------|
|
|
37
|
+
| `botToken` | Yes | Slack bot token (starts with `xoxb-`) |
|
|
38
|
+
| `signingSecret` | Yes | Slack signing secret for webhook verification |
|
|
39
|
+
|
|
40
|
+
## Required Slack Scopes
|
|
41
|
+
|
|
42
|
+
Your Slack app needs these OAuth scopes:
|
|
43
|
+
|
|
44
|
+
**Bot Token Scopes:**
|
|
45
|
+
- `chat:write` - Send messages
|
|
46
|
+
- `channels:history` - Read channel messages
|
|
47
|
+
- `groups:history` - Read private channel messages
|
|
48
|
+
- `im:history` - Read DM messages
|
|
49
|
+
- `mpim:history` - Read group DM messages
|
|
50
|
+
- `reactions:read` - Read reactions
|
|
51
|
+
- `reactions:write` - Add reactions
|
|
52
|
+
- `files:read` - Read file attachments
|
|
53
|
+
- `users:read` - Read user info
|
|
54
|
+
|
|
55
|
+
**Event Subscriptions:**
|
|
56
|
+
- `message.channels` - Channel messages
|
|
57
|
+
- `message.groups` - Private channel messages
|
|
58
|
+
- `message.im` - Direct messages
|
|
59
|
+
- `message.mpim` - Group DMs
|
|
60
|
+
- `app_mention` - @mentions
|
|
61
|
+
- `reaction_added` - Reaction events
|
|
62
|
+
- `reaction_removed` - Reaction events
|
|
63
|
+
|
|
64
|
+
## Features
|
|
65
|
+
|
|
66
|
+
- Message posting and editing
|
|
67
|
+
- Thread subscriptions
|
|
68
|
+
- Reaction handling (add/remove/events)
|
|
69
|
+
- File attachments
|
|
70
|
+
- Rich cards (Block Kit)
|
|
71
|
+
- Action callbacks (interactive components)
|
|
72
|
+
- Direct messages
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chat-adapter/slack",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Slack adapter for chat",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@slack/web-api": "^7.8.0",
|
|
20
|
-
"chat": "4.0.
|
|
20
|
+
"chat": "4.0.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^22.10.2",
|
|
@@ -25,6 +25,15 @@
|
|
|
25
25
|
"typescript": "^5.7.2",
|
|
26
26
|
"vitest": "^2.1.8"
|
|
27
27
|
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/vercel-labs/chat.git",
|
|
31
|
+
"directory": "packages/adapter-slack"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/vercel-labs/chat#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/vercel-labs/chat/issues"
|
|
36
|
+
},
|
|
28
37
|
"publishConfig": {
|
|
29
38
|
"access": "public"
|
|
30
39
|
},
|