This guide provides step-by-step instructions for installing Case in your Slack workspace.
Before you begin, ensure you have:
- Slack workspace with admin permissions
- PostgreSQL database (version 12 or higher)
- Node.js (version 18 or higher)
- Git for cloning the repository
- Go to api.slack.com/apps
- Click "Create New App"
- Select "From an app manifest"
- Choose your workspace
- Select "YAML" format
- Copy the entire contents of
manifest.ymlfrom this repository - Paste it into the text box
- Click "Next" and review the configuration
- Click "Create"
- On the app configuration page, go to "Install App"
- Click "Install to Workspace"
- Review and accept the permissions
- You'll be redirected back to the app configuration
From the Slack app configuration page, collect these tokens:
-
Bot User OAuth Token (starts with
xoxb-)- Found under "OAuth & Permissions"
-
Signing Secret
- Found under "Basic Information" → "App Credentials"
-
App-Level Token (for Socket Mode)
- Go to "Basic Information" → "App-Level Tokens"
- Click "Generate Token and Scopes"
- Name it (e.g., "socket-mode")
- Add scope:
connections:write - Click "Generate"
- Copy the token (starts with
xapp-)
- Go to "Socket Mode" in the left sidebar
- Toggle "Enable Socket Mode" to On
- Select the app-level token you just created
# Using PostgreSQL command line
createdb case_production
# Or using psql
psql -U postgres -c "CREATE DATABASE case_production;"-- Connect to PostgreSQL as superuser
psql -U postgres
-- Create user and grant permissions
CREATE USER case_user WITH PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE case_production TO case_user;git clone https://github.com/agrieser/case.git
cd casenpm installCreate a .env file in the project root:
# Database
DATABASE_URL="postgresql://case_user:secure_password@localhost:5432/case_production"
# Slack Credentials (from Step 1.3)
SLACK_BOT_TOKEN="xoxb-your-bot-token"
SLACK_SIGNING_SECRET="your-signing-secret"
SLACK_APP_TOKEN="xapp-your-app-token"
# Required Configuration
ISSUES_CHANNEL_ID="C123456789" # See below for how to find this
# Optional Configuration
NODE_ENV="production"
# INCIDENT_RESPONSE_GROUP_ID="S123456789" # Optional: User group for incidents
# ALLOWED_WORKSPACE_IDS="T123456,T789012" # Optional: Restrict to workspaces
# PAGERDUTY_ROUTING_KEY="your-32-char-routing-key" # Optional: Enable PagerDuty integrationTo find the channel ID for notifications:
- Open Slack in your browser
- Navigate to the channel you want to use (e.g., #incidents)
- Click the channel name at the top
- Scroll down and click "More" → "Additional options"
- The Channel ID is at the bottom (starts with C)
Alternatively, in Slack:
- Right-click the channel name
- Select "View channel details"
- The ID is shown at the bottom
npm run prisma:migrate deployThis creates all necessary database tables.
npm run buildFor production:
npm startFor development with auto-reload:
npm run dev- In Slack, type
/case help - You should see the help message with available commands
- Try creating a test investigation:
/case create Test investigation
# Install PM2 globally
npm install -g pm2
# Start application
pm2 start dist/index.js --name case
# Save PM2 configuration
pm2 save
pm2 startupFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
CMD ["node", "dist/index.js"]Create /etc/systemd/system/case.service:
[Unit]
Description=Case Slack Bot
After=network.target
[Service]
Type=simple
User=case
WorkingDirectory=/opt/case
ExecStart=/usr/bin/node /opt/case/dist/index.js
Restart=on-failure
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target- Check Socket Mode is enabled in Slack app settings
- Verify the app-level token has
connections:writescope - Check application logs for connection errors
- Verify PostgreSQL is running:
pg_isready - Check database exists:
psql -U postgres -l - Test connection string:
psql "postgresql://...""
- Ensure bot is installed to workspace
- Verify all required scopes are present in manifest
- Reinstall the app if permissions were changed
- Check bot has
channels:managepermission - Verify workspace allows apps to create channels
- Check for rate limiting in logs
Case can automatically create and resolve PagerDuty incidents when investigations are escalated.
-
Create PagerDuty Integration
- Log into your PagerDuty account
- Navigate to your service
- Go to Integrations tab
- Click "Add Integration"
- Select "Events API V2"
- Copy the Integration Key (Routing Key)
-
Configure Case
- Add to your
.envfile:PAGERDUTY_ROUTING_KEY="your-32-character-routing-key" - Restart the Case application
- Add to your
-
How It Works
- When you run
/case incident, a PagerDuty incident is automatically triggered - When you run
/case resolve, the PagerDuty incident is automatically resolved - Check status with
/case statusin any investigation channel - PagerDuty failures don't block Case operations
- When you run
- Configure incident response team: Set
INCIDENT_RESPONSE_GROUP_ID - Enable PagerDuty integration: Set
PAGERDUTY_ROUTING_KEY - Set up monitoring for the application
- Configure log aggregation
- Set up database backups
- Review SECURITY.md for security best practices
- Check application logs:
npm run logs - Join our Discussions
- Report issues: GitHub Issues