@idiomark/adapter-slack
Slack adapter for Idiomark extraction - Complete implementation with Web API integration.
Features
- Messages: Channel messages, DMs, and MPIMs
- Reactions: Emoji reactions to messages (extracted as content)
- Threads: Full thread conversation support
- Files: Document and media sharing analysis
- Rate Limiting: Tier-based rate limit handling
- Personality Signals: Voice, communication, interests, collaboration
Authentication
Uses Bot token authentication (OAuth):
const adapter = new SlackAdapter({
botToken: 'xoxb-your-bot-token'
})
Required Bot Scopes
| Scope | Purpose |
|---|---|
channels:history | Public channel messages |
groups:history | Private channel messages |
im:history | Direct messages |
mpim:history | Multi-person DMs |
channels:read | List channels |
users:read | User profiles |
files:read | File information |
Rate Limits
Implements Slack's tier-based rate limiting:
| Tier | Limit | Endpoints |
|---|---|---|
| 1 | 1/min | auth.test |
| 2 | 20/min | conversations.info, users.info |
| 3 | 50/min | conversations.history, replies |
| 4 | 200/min | conversations.list |
Usage
import { SlackAdapter } from '@idiomark/adapter-slack'
const adapter = new SlackAdapter({
botToken: process.env.SLACK_BOT_TOKEN
})
await adapter.authenticate()
const result = await adapter.extractRawText({
limit: 100,
includeReplies: true,
includeReactions: true
})
console.log(`Extracted ${result.metadata.sampleSize} items`)
console.log(`Personality signals:`, result.personalitySignals)
Data Types
| Type | Description |
|---|---|
message | Channel/DM messages |
reply | Thread replies |
reaction | Emoji reactions |
file | Shared documents |
profile | User profile data |
Personality Signals
- Voice: Emoji usage, common phrases
- Communication: Thread count, reply patterns
- Interests: Channels, mentions, domains
- Collaboration: Files shared, channels participated
API Reference
See the usage examples above for the main API methods.
License
MIT