Skip to content

[examples] Add Slack Socket Mode integration demo #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JCMarques15
Copy link

@JCMarques15 JCMarques15 commented Apr 30, 2025

Motivation

Chainlit already documents HTTP-based Slack integrations, but many
developers prefer Socket Mode because it works behind a firewall and
doesn’t need a public tunnel.
This example shows the minimal setup needed to run Chainlit with
Slack’s WebSocket transport.

What’s inside

  • examples/slack_socket_mode/
    • app.py – basic echo bot; replies with the sender’s e-mail.
    • .env.example – placeholder for SLACK_BOT_TOKEN,
      SLACK_WEBSOCKET_TOKEN, SLACK_SIGNING_SECRET.
    • requirements.txt - chainlit is the only high level requirement
  • README section that links to, and quickly explains, the example.

How to try it

cd examples/slack_socket_mode
cp .env.example .env            # fill in your real tokens
pip install -r requirements.txt
python app.py

Related PRs

chainlit repository: #1436
docs repository: #230

- Create `.env.example` with Slack token configuration
- Add basic Slack websocket handler in `app.py`
- Include requirements.txt with chainlit dependency

Implements a simple Slack integration example using chainlit to demonstrate
websocket handling. The example shows how to process messages from Slack
users and respond back with acknowledgment including the user's email.
- Create readme.md for Slack Socket Mode integration
- Document prerequisites, setup, and troubleshooting
- Add project layout and quick start guide
- Include detailed explanation of how the integration works

Adds comprehensive documentation for the Slack Socket Mode example, including
setup instructions, requirements, and troubleshooting tips. The documentation
covers token configuration, project structure, and implementation details
for connecting Chainlit to Slack via WebSockets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant