🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
Slack Integration Setup Guide
This guide walks you through setting up and testing the Langfuse Slack integration for local development.
Prerequisites
- Node.js and pnpm installed
- Access to a Slack workspace where you can create apps
- A tunneling tool for a public HTTPS URL (ngrok, or VS Code port forwarding)
Setup Steps
1. Create a Slack App
- Go to Slack API Apps page
- Click "Create New App" → "From an app manifest"
- Select your workspace
- Copy the contents of
app_manifest.jsonfrom this directory and paste it into the manifest editor - Click "Create" to create your app
2. (Optional) Add App Icon
- In your Slack app settings, go to "Basic Information"
- Upload the Langfuse icon from
web/public/icon512.pngas your app's avatar - This will make your app more recognizable in Slack
3. Configure Environment Variables
- In your Slack app settings, go to "Basic Information"
- Copy the Client ID and Client Secret
- Generate a random secret using
openssl rand -base64 32 | tr -d "=+/" | cut -c1-32to use as state secret - Add these to your
.envfile:SLACK_CLIENT_ID=your_client_id_here SLACK_CLIENT_SECRET=your_client_secret_here SLACK_STATE_SECRET=your_state_secret_here
4. Expose your local server over a public HTTPS URL
Slack's OAuth flow only redirects back to a publicly reachable HTTPS URL —
http://localhost:3000 is rejected with bad_redirect_uri. The simplest way to
get one in dev is a tunnel:
- ngrok (
brew install ngrok):
Use the printedngrok http 3000https://<subdomain>.ngrok-free.appURL. - VS Code port forwarding: open the Ports panel, forward port
3000, and set its visibility to Public. Use the printedhttps://<id>-3000.<region>.devtunnels.msURL.
Then point Langfuse and Slack at that URL:
- Set
NEXTAUTH_URLin your.envto the tunnel URL (it is used to build the OAuthredirect_uri):NEXTAUTH_URL="https://<your-tunnel-host>" - In your Slack app's OAuth & Permissions settings, register the redirect
URL
https://<your-tunnel-host>/api/public/slack/oauth(theapp_manifest.jsonships thelocalhostURL; replace/add your tunnel host).
Tunnel hosts usually change each run (unless you have a reserved domain), so update both
NEXTAUTH_URLand the Slack redirect URL whenever it changes.
5. Start Development Server
From the repository root, run:
pnpm run dev
The tunnel from step 4 terminates TLS and forwards to your local server, so plain HTTP dev is fine — no local certificates needed.
6. Test the Integration
- Navigate to your Langfuse project settings
- Look for the Slack integration section
- Click "Connect to Slack" to initiate the OAuth flow
- Authorize the app in your Slack workspace
- Test sending a message using the "Send Test Message" button
Troubleshooting
Common Issues
bad_redirect_uri/ "Invalid redirect URI":NEXTAUTH_URLand the redirect URL registered in your Slack app must both be the exact public HTTPS tunnel host (https://<your-tunnel-host>/api/public/slack/oauth). Alocalhostorhttp://value will be rejected. If your tunnel host changed, update both.- Environment variables not found: Verify your
.envfile is in the correct location and contains the Slack credentials
Features
The Slack integration provides:
- Real-time alerts: Get notified about critical errors and anomalies
- Prompt monitoring: Receive alerts on prompt edits and creations
- Direct links: Jump from Slack messages directly to prompts in Langfuse
- Channel configuration: Set up different notification channels per project
- Test messages: Verify your integration is working correctly
Development Notes
- The integration uses Slack's OAuth 2.0 flow for secure authentication
- Webhook endpoints are available at
/api/public/slack/install - OAuth callback is handled at
/api/public/slack/oauth - All Slack API interactions are handled through the
SlackServicein the shared package
Production Deployment
For production deployment, ensure:
- Update the OAuth redirect URLs in your Slack app to include your production domain
- Set up proper SSL certificates for your production environment
- Configure environment variables in your production environment