All templates
SlackIntermediate15 min
×
Slack AI Agent
A production-ready AI agent that lives in Slack. Marketing teams describe what they need in plain English and the agent handles the rest — asking smart questions, generating on-brand images for every platform, and posting them directly in the thread with Regenerate and Download buttons.
The code
3 snippets
# 1. Clone and link Supabase
git clone https://github.com/Guru6163/bloom-slack
cd bloom-slack
supabase login
supabase link --project-ref YOUR_PROJECT_REF
# 2. Run database migrations
supabase db push
# 3. Create your Slack App
# Go to api.slack.com/apps → Create New App → From Manifest
# Use the manifest in the repo: slack-manifest.json
# After creating:
# Basic Information → App Credentials → copy:
# - Client ID
# - Client Secret
# - Signing Secret
# OAuth & Permissions → install to workspace → copy:
# - Bot User OAuth Token (xoxb-...)
# 4. Set secrets
supabase secrets set OPENAI_API_KEY="sk-..."
supabase secrets set SLACK_CLIENT_ID="your_client_id"
supabase secrets set SLACK_CLIENT_SECRET="your_client_secret"
supabase secrets set SLACK_SIGNING_SECRET="your_signing_secret"
# Note: SLACK_BOT_TOKEN is NOT set globally here —
# it is saved per workspace automatically during OAuth install.
# Note: BLOOM_API_KEY is NOT set globally here —
# each workspace enters their own key during setup.
# 5. Deploy functions
supabase functions deploy slack-oauth --no-verify-jwt
supabase functions deploy slack-setup --no-verify-jwt
supabase functions deploy slack-events --no-verify-jwt
supabase functions deploy openai-agent --no-verify-jwt
supabase functions deploy run-generation --no-verify-jwt
# 6. Update Slack App URLs (api.slack.com → your app)
# OAuth Redirect URL: https://YOUR_REF.supabase.co/functions/v1/slack-oauth
# Event Subscriptions URL: https://YOUR_REF.supabase.co/functions/v1/slack-events
# Interactivity URL: https://YOUR_REF.supabase.co/functions/v1/slack-events
# Slash Command URL: https://YOUR_REF.supabase.co/functions/v1/slack-events
# 7. Install the Slack app to your workspace
# api.slack.com/apps → your app → OAuth & Permissions → Install to Workspace
# After install → check your Slack DMs for the Bloom setup link
# Click the link → enter your Bloom API key → select brand → done
# 8. Test it
# Go to any Slack channel and type:
# @Bloom create a summer sale banner for InstagramReplace
bloom_sk_... with your API keyGet free API key →