Overview
ChitChatPosts is a Slack bot that observes your team's conversations and suggests social media posts. There are two ways to use it:
Option A: Hosted Version
We handle everything. Just click "Add to Slack" and you're done. Best for most teams.
- ✓ One-click installation
- ✓ Automatic updates
- ✓ No server to manage
Option B: Self-Hosted
Full control. Clone the repo, use your own API keys, run on your infrastructure.
- ✓ Complete data control
- ✓ Use your own LLM keys
- ✓ Customize everything
Quick Start (Hosted)
Get up and running in under 2 minutes.
Allow Permissions
Slack will ask you to authorize the following:
- Read messages in channels the bot is added to
- Send messages as the bot
- Access to slash commands
Invite to Channels
Add the bot to channels you want it to monitor:
/invite @ChitChatPosts
Start Analyzing
After some conversation happens, run:
/chitchatposts analyze
Prerequisites (Self-Hosted)
Before you begin, make sure you have:
JavaScript runtime
Package manager
Admin access required
OpenAI or Claude
Step 1: Create Slack App
Go to Slack API Dashboard
Visit api.slack.com/apps and click "Create New App".
Choose "From Scratch"
Name your app (e.g., "ChitChatPosts") and select your workspace.
Enable Socket Mode
Go to Socket Mode in the sidebar and enable it. Generate an
App-Level Token with connections:write scope.
SLACK_APP_TOKEN=xapp-1-A0123456789-...
Add Bot Scopes
Go to OAuth & Permissions and add these Bot Token Scopes:
Install to Workspace
Click "Install to Workspace" and authorize. Copy the Bot User OAuth Token:
SLACK_BOT_TOKEN=xoxb-1234567890-...
Get Signing Secret
Go to Basic Information and copy the Signing Secret:
SLACK_SIGNING_SECRET=abc123def456...
Create Slash Command
Go to Slash Commands and create a new command:
| Command | /chitchatposts |
| Description | Analyze conversations for post-worthy content |
| Usage Hint | [analyze | history 4h | sync] |
Enable Events
Go to Event Subscriptions, enable events, and subscribe to:
Step 2: Environment Variables
Create a .env file in your project root:
# Slack Configuration (Required)
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_APP_TOKEN=xapp-your-app-token
# LLM Configuration (Choose One)
LLM_PROVIDER=openai
OPENAI_API_KEY=sk-your-openai-key
# Or use Claude
# LLM_PROVIDER=claude
# CLAUDE_API_KEY=your-claude-key
# Optional Configuration
PORT=3000
BUFFER_WINDOW_HOURS=4
MIN_MESSAGES_FOR_ANALYSIS=5
| Variable | Required | Description |
|---|---|---|
SLACK_BOT_TOKEN |
✅ | Bot User OAuth Token (starts with xoxb-) |
SLACK_SIGNING_SECRET |
✅ | From Basic Information page |
SLACK_APP_TOKEN |
✅ | App-Level Token (starts with xapp-) |
LLM_PROVIDER |
❌ | Either "openai" or "claude" (default: openai) |
OPENAI_API_KEY |
❌* | Required if using OpenAI |
CLAUDE_API_KEY |
❌* | Required if using Claude |
PORT |
❌ | Server port (default: 3000) |
BUFFER_WINDOW_HOURS |
❌ | How long to keep messages (default: 4) |
MIN_MESSAGES_FOR_ANALYSIS |
❌ | Minimum messages needed (default: 5) |
Step 3: Run Locally
Clone the Repository
git clone https://github.com/yourusername/chitchatposts.git
cd chitchatposts
Install Dependencies
npm install
Setup Environment
cp .env.example .env
# Edit .env with your tokens
Start the Bot
npm run dev
You should see:
⚡️ ChitChatPosts is running!
Mode: Socket Mode (real-time events)
LLM Provider: openai
LLM Configured: ✅ Yes
Step 4: Deploy to Production
Deploy ChitChatPosts to any Node.js hosting platform:
LLM Setup
ChitChatPosts supports both OpenAI and Claude. Choose one:
- Go to OpenAI API Keys
- Create a new API key
- Add to your
.env:
LLM_PROVIDER=openai
OPENAI_API_KEY=sk-your-key-here
Model used: GPT-4o-mini (cost-effective, fast, accurate)
- Go to Anthropic Console
- Create a new API key
- Add to your
.env:
LLM_PROVIDER=claude
CLAUDE_API_KEY=your-claude-key-here
Model used: Claude 3 Sonnet (nuanced understanding)
Commands Reference
/chitchatposts analyze
Analyze the current message buffer for post-worthy content.
/chitchatposts analyze
/chitchatposts history [time]
Fetch and analyze messages from a specific time period.
/chitchatposts history 1h # Last hour
/chitchatposts history 4h # Last 4 hours
/chitchatposts history 1d # Last day
/chitchatposts sync
Fetch all messages since the last sync point.
/chitchatposts sync
Multi-Workspace OAuth (Advanced)
To support multiple workspaces, you need to implement OAuth:
Required Changes:
- Add Redirect URL in Slack App Dashboard → OAuth & Permissions
- Store tokens per workspace instead of using env vars
- Use dynamic token lookup when responding to events
// Example: OAuth callback handler
app.get('/slack/oauth/callback', async (req, res) => {
const { code, team_id } = req.query;
const result = await client.oauth.v2.access({
client_id: process.env.SLACK_CLIENT_ID,
client_secret: process.env.SLACK_CLIENT_SECRET,
code
});
// Store token for this workspace
await saveToken(team_id, result.access_token);
res.redirect('/success');
});
Automated Suggestions (Autopilot)
ChitChatPosts can automatically analyze your channels and post suggestions without manual commands. This is the Autopilot feature.
Enable Autopilot
Add these environment variables to your .env file:
# Enable automated analysis
CRON_ENABLED=true
# Channel where suggestions will be posted
SUGGESTIONS_CHANNEL_ID=C0123456789
# Channels to monitor (comma-separated, leave empty for all)
MONITORED_CHANNELS=C0123456789,C0987654321
| Variable | Required | Description |
|---|---|---|
CRON_ENABLED |
❌ | Set to "true" to enable automated analysis (default: false) |
SUGGESTIONS_CHANNEL_ID |
✅* | Channel ID where suggestions will be posted |
MONITORED_CHANNELS |
❌ | Comma-separated list of channel IDs to monitor |
Schedule
When Autopilot is enabled, the bot runs on the following schedule:
- Every 6 hours (0:00, 6:00, 12:00, 18:00 UTC) — Analyzes the last 6 hours of conversation
- Daily at midnight (UTC) — Comprehensive 24-hour summary
Smart Features
Skips suggestions that are too similar to previous ones (>80% match)
Won't re-analyze if no new messages have arrived since the last run
All automated suggestions go to a channel you specify
Suggestions are never posted to social media automatically
Example Output
Here's what an automated suggestion looks like in Slack:
💡 New Post Suggestion
Source: 6-hour analysis • Generated automatically
Why this works:
User shares a significant productivity improvement achieved through AI tools, showcasing a tangible benefit that resonates with others in the industry.
📝 LinkedIn Draft:
Excited to share a recent breakthrough! We leveraged AI to reduce our publication time from 4 hours to just 2 minutes...
𝕏 Twitter/X Draft:
Just reduced our publication time from 4 hours to 2 mins using AI! 🚀 Huge boost in team performance. #Productivity #AI
🔒 Please review and edit before posting. Human approval required.
Need Help?
Can't find what you're looking for?