A comprehensive tool for extracting Slack workspace data, analyzing it with GPT-4o, and generating beautiful presentations via Gamma API.
- Slack Data Extraction: Extract messages, threads, and metadata from Slack channels
- AI-Powered Analysis: Analyze community data using GPT-4o for insights
- Presentation Generation: Create beautiful presentations via Gamma API
- Automated Workflows: GitHub Actions integration for scheduled runs
- Interactive Menu: User-friendly interface for different operations
- Node.js 16+
- Slack Bot Token with appropriate permissions (see required scopes below)
- Dropbox API access
- OpenAI API key (for analysis)
- Gamma API key (for presentations)
Your Slack bot token must have these OAuth scopes:
channels:history- Read messages from public channelschannels:read- List public channelsreactions:read- Read reaction data from messages
To add these scopes:
- Go to https://api.slack.com/apps
- Select your Slack app
- Navigate to "OAuth & Permissions" in the left sidebar
- Under "Scopes" > "Bot Token Scopes", add the required scopes
- Reinstall/update the app in your workspace when prompted
-
Clone the repository
git clone <your-repo-url> cd slack-extractor
-
Install dependencies
npm install
-
Build TypeScript
npm run build
Create a .env file in the root directory:
# Required - Slack Configuration
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_WORKSPACE_ID=your-workspace-id
# Required - Dropbox Configuration
DROPBOX_ACCESS_TOKEN=your-dropbox-token
DROPBOX_REFRESH_TOKEN=your-refresh-token
DROPBOX_CLIENT_ID=your-client-id
DROPBOX_CLIENT_SECRET=your-client-secret
DROPBOX_FOLDER_PATH=/slack-exports
# Optional - Analysis Configuration
OPENAI_API_KEY=sk-your-openai-key
GAMMA_API_KEY=your-gamma-api-key
GPT_MODEL=gpt-4o
CHUNK_SIZE=15
# Optional - Scheduling
SCHEDULE_ENABLED=false
SCHEDULE_CRON=0 9 * * 1
RUN_IMMEDIATELY=false
# Optional - Application Settings
LOG_LEVEL=info
API_DELAY_MS=1000
MAX_MESSAGES_PER_CHANNEL=150
MAX_THREAD_REPLIES=20For automated workflows, add these secrets to your GitHub repository:
Required Secrets:
SLACK_BOT_TOKENSLACK_WORKSPACE_IDDROPBOX_ACCESS_TOKENDROPBOX_REFRESH_TOKENDROPBOX_CLIENT_IDDROPBOX_CLIENT_SECRET
Optional Secrets (for analysis):
OPENAI_API_KEYGAMMA_API_KEY
npm startThis will show an interactive menu:
π Slack Data Extractor & Analyzer
=====================================
1. Extract Slack data only
2. Run full analysis pipeline (extract + analyze + present)
3. Test API connections
4. Exit
Choose an option (1-4):
# Extract data only
node dist/index.js --once
# Run full pipeline
node dist/index.js --analyze
# Interactive mode
node dist/index.js --interactive# Run with TypeScript directly
npm run dev
# Watch mode for development
npm run build:watchThe analysis pipeline creates focused, actionable reports with:
- Community Overview: Activity metrics and themes
- What's Resonating: Features people love and success stories
- What's Challenging: Recurring questions and friction points
- Feature Wishlist: User requests and needs
- Notable Feedback: Direct quotes with source links
- Text-only content (no AI-generated images)
- Interactive Slack links preserved in presentations
- 8 focused cards (reduced from 15 based on feedback)
- Professional formatting with markdown preservation
The workflow runs every Monday at 9 AM UTC and includes:
- Data Extraction: Pulls latest Slack data
- AI Analysis: Processes data with GPT-4o
- Presentation Generation: Creates Gamma presentation
- Artifact Upload: Saves results for 30 days
You can also trigger the workflow manually:
- Go to Actions tab in GitHub
- Select Slack Data Extractor & Analyzer
- Click Run workflow
slack-extractor/
βββ src/
β βββ config/ # Configuration management
β βββ services/ # Core services
β β βββ slackAnalyzer.ts # Main analysis orchestrator
β β βββ openaiClient.ts # GPT-4o integration
β β βββ gammaClient.ts # Gamma API integration
β β βββ chunkProcessor.ts # Data chunking logic
β β βββ slackService.ts # Slack API integration
β βββ types/ # TypeScript interfaces
β βββ utils/ # Utility functions
β βββ index.ts # Main entry point
βββ dist/ # Compiled JavaScript
βββ exports/ # Generated CSV and reports
βββ .github/workflows/ # GitHub Actions
βββ package.json
- Model:
gpt-4o(upgraded from gpt-4o-mini) - Max Tokens: 16,000 completion tokens
- Chunk Size: 15 messages per chunk
- Temperature: 0.7 for balanced creativity
- Format: Presentation
- Cards: 8 (optimized based on feedback)
- Text Mode: Preserve (maintains markdown links)
- Images: Disabled (text-only content)
The application provides comprehensive logging:
- Info: General operation status
- Warn: Non-critical issues
- Error: Critical failures with context
- Debug: Detailed operation traces
Logs include:
- API call status and timing
- Token usage statistics
- File processing progress
- Error details with context
-
"No CSV files found"
- Ensure Slack extraction completed successfully
- Check
exports/directory exists - Verify Slack bot has channel access
-
"API connection failed"
- Verify API keys are correct
- Check network connectivity
- Ensure API quotas aren't exceeded
-
"Empty presentation"
- Check if analysis generated content
- Verify Gamma API key permissions
- Review markdown formatting
Enable detailed logging:
LOG_LEVEL=debug node dist/index.js --interactive- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
- Amanda for detailed feedback and requirements
- OpenAI for GPT-4o API
- Gamma for presentation generation
- Slack for workspace data access
Need help? Check the logs, review the configuration, or open an issue for support.