Slack Integration

Bring Codmir into your Slack workspace for AI-powered workflow: create tickets, run analyses, and manage automation directly from channels.

Prerequisites

  • A Slack workspace where you can install apps
  • Codmir app running (local or deployed)

Install the Slack app

  1. Visit Codmir → Integrations → Slack or open: /integrations/slack/install.
  2. Click Add to Slack and authorize the app for your workspace.
  3. On success you will be redirected to /integrations/slack/installed.

Tip: You can deep-link from marketing to the installer at /integrations/slack/install.

Install via button

Add to Slack

Slack app configuration

Set these in your Slack App at api.slack.com/apps → Your App → OAuth & Permissions.

Redirect URLs

Development

http://localhost:3000/api/integrations/slack/oauth/callback

Staging

https://staging.codmir.com/api/integrations/slack/oauth/callback

Production

https://codmir.com/api/integrations/slack/oauth/callback

Bot token scopes

Add the following scopes:

  • app_mentions:read
  • assistant:write
  • canvases:read
  • channels:history
  • channels:join
  • channels:read
  • chat:write
  • chat:write.public
  • commands
  • conversations.connect:read
  • files:read
  • im:history
  • incoming-webhook
  • reactions:write
  • users:read
  • users:read.email

Environment variables

Add to your .env (values from your Slack app → Basic Information and OAuth & Permissions):

# Slack Bot Configuration
SLACK_BOT_TOKEN="xoxb-your-bot-token"
SLACK_SIGNING_SECRET="your-signing-secret"
SLACK_CLIENT_ID="9565766977975.9608711411952"
SLACK_CLIENT_SECRET="your-client-secret"

# Slack OAuth Install URL (example)
NEXT_PUBLIC_INSTALL_CODMIR_SLACK_APP_URL="https://slack.com/oauth/v2/authorize?client_id=YOUR_CLIENT_ID&scope=...&user_scope="

How it works

  • Installer UI: /integrations/slack/install
  • OAuth callback: /api/integrations/slack/oauth/callback
  • Success page: /integrations/slack/installed

The callback exchanges the authorization code, stores tokens and workspace metadata in the Integration model, and redirects to the success page.

Using the bot

Mention @codmir or DM the bot:

Link channel to project

@codmir link [project-id]

Analyze an issue

@codmir analyse Login page not responsive on mobile

Full automation

@codmir fix Button alignment broken in checkout flow

Create a ticket

@codmir create Add dark mode support

Check status

@codmir status #42

Trigger PR review

@codmir review 123

Troubleshooting

  • Invalid redirect_uri: Make sure the redirect URL matches exactly in Slack settings (no trailing slash differences) and uses HTTPS in production.
  • Missing required scopes: Add scopes above and reinstall the app to grant new permissions.
  • Bot not responding: Verify SLACK_BOT_TOKEN, add the bot to the channel, and ensure event subscriptions/webhooks are reachable.