This package provides Slack integration for the Eliza AI agent.
- A Slack workspace where you have permissions to install apps
- ngrok installed for local development (
brew install ngrok
on macOS) - Node.js and pnpm installed
- Open a terminal and start ngrok on port 3069 (or your configured port):
ngrok http 3069
- Copy the HTTPS URL (e.g.,
https://xxxx-xx-xx-xx-xx.ngrok-free.app
) - Keep this terminal open - closing it will invalidate the URL
- Go to Slack API Apps page
- Click "Create New App"
- Choose "From an app manifest"
- Select your workspace
- Copy this manifest, replacing
YOUR_NGROK_URL
with your ngrok HTTPS URL:
display_information:
name: eve
description: Eve elizaos
background_color: "#143187"
features:
app_home:
home_tab_enabled: true
messages_tab_enabled: false
messages_tab_read_only_enabled: false
bot_user:
display_name: eve
always_online: false
oauth_config:
scopes:
bot:
- app_mentions:read
- channels:history
- channels:join
- channels:read
- chat:write
- files:read
- files:write
- groups:history
- groups:read
- im:history
- im:read
- im:write
- mpim:history
- mpim:read
- mpim:write
- users:read
settings:
event_subscriptions:
request_url: YOUR_NGROK_URL/slack/events
bot_events:
- app_mention
- message.channels
- message.groups
- message.im
- message.mpim
- file_shared
interactivity:
is_enabled: true
request_url: YOUR_NGROK_URL/slack/interactions
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false
- Click "Create"
- On the "Basic Information" page, scroll down to "App Credentials"
- Copy all the credentials - you'll need them in Step 3
Before proceeding to install the app, make sure to verify the event subscription:
- In your Slack App settings, go to "Event Subscriptions."
- Enter the request URL (your ngrok HTTPS URL followed by /slack/events).
- Slack will send a verification request to this URL.
- Ensure your server is running and configured to respond to the url_verification event by echoing back the challenge token provided in the request.
- Once verified, you will see a confirmation in your Slack app settings.
- Create or edit
.env
file in your project root:SLACK_APP_ID= # From Basic Information > App Credentials > App ID SLACK_CLIENT_ID= # From Basic Information > App Credentials > Client ID SLACK_CLIENT_SECRET= # From Basic Information > App Credentials > Client Secret SLACK_SIGNING_SECRET= # From Basic Information > App Credentials > Signing Secret SLACK_BOT_TOKEN= # From OAuth & Permissions > Bot User OAuth Token (starts with xoxb-) SLACK_VERIFICATION_TOKEN= # From Basic Information > App Credentials > Verification Token SLACK_SERVER_PORT=3069 # Must match the port you used with ngrok
- In your Slack App settings, go to "Install App"
- Click "Install to Workspace"
- Review the permissions and click "Allow"
- Start your Eliza server
- Check the logs for successful connection
- Test the bot:
- In Slack, invite the bot to a channel:
/invite @eve
- Try mentioning the bot:
@eve hello
- Check your server logs for event reception
- In Slack, invite the bot to a channel:
- Make sure ngrok is running and the URL in your app settings matches exactly
- Check that the
/slack/events
endpoint is accessible - Verify your environment variables are set correctly
- Check server logs for incoming events
- Verify the bot is in the channel
- Ensure all required scopes are granted
- Try reinstalling the app to refresh permissions
- Verify Event Subscriptions are enabled
- Check the Request URL is correct and verified
- Confirm all bot events are subscribed
- Ensure the bot token starts with
xoxb-
If you restart ngrok, you'll get a new URL. You'll need to:
- Copy the new ngrok HTTPS URL
- Update the Request URLs in your Slack App settings:
- Event Subscriptions > Request URL
- Interactivity & Shortcuts > Request URL
- Wait for URL verification to complete
- Never commit your
.env
file or tokens to version control - Rotate your tokens if they're ever exposed
- Use HTTPS URLs only for Request URLs
- Keep your ngrok and server running while testing
- Start ngrok:
ngrok http 3069
- Update Slack App URLs with new ngrok URL
- Start the server:
pnpm start
- Monitor logs for events and errors
Enable detailed logging by setting:
DEBUG=eliza:*
- Update the manifest if adding new scopes
- Reinstall the app to apply new permissions
- Update documentation for any new environment variables
For issues or questions:
- Check the Common Issues section above
- Review server logs for errors
- Verify all setup steps are completed
- Open an issue with:
- Error messages
- Server logs
- Steps to reproduce