Registry / communication / slack-bolt

slack-bolt

JSON →
library1.30.0pypypi✓ verified 25d ago

Slack Bolt for Python is a framework that makes it easy to build Slack apps using the Slack Platform. It simplifies common patterns like handling events, processing interactive components, and sending messages. The library is actively maintained with frequent releases, typically monthly, and is currently at version 1.28.0.

pip install slack-bolt
INSTALL
IMPORT
SIG · SLACK-BOLT
S
slack-bolt
communicationpythonv1.30.0
Install
2.1s avg
Import
541ms
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.30.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.566s · 24.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.1s · import 0.516s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

App
from slack_bolt import App
AsyncApp
from slack_bolt.async_app import AsyncApp
Use AsyncApp for asynchronous operations and improved performance, especially with ASGI servers.
SocketModeHandler
from slack_bolt.adapter.socket_mode import SocketModeHandler
Required for local development and connecting to Slack via WebSockets.
FlaskResponder
from slack_bolt.adapter.flask import FlaskResponder
One of several HTTP adapters for deploying Bolt apps to web servers.

This quickstart demonstrates a minimal Slack Bolt app that responds to 'hello' messages in a channel. It uses Socket Mode for local development, requiring `SLACK_BOT_TOKEN`, `SLACK_SIGNING_SECRET`, and `SLACK_APP_TOKEN` environment variables. For production deployments, an HTTP adapter like Flask, Django, or AWS Lambda is typically used.

import os from slack_bolt import App from slack_bolt.adapter.socket_mode import SocketModeHandler # Initialize your app with your bot token and signing secret # Ensure SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET, and SLACK_APP_TOKEN are set in your environment app = App( token=os.environ.get("SLACK_BOT_TOKEN", ""), signing_secret=os.environ.get("SLACK_SIGNING_SECRET", "") ) # Listen for messages containing "hello" @app.message("hello") def message_hello(message, say): # say() sends a message to the same channel where the event was triggered say(f"Hey there <@{message['user']}>!") # Start your app # For local development, Socket Mode is often used. # For production, you'd typically use an HTTP adapter (e.g., Flask, AWS Lambda). if __name__ == "__main__": # SLACK_APP_TOKEN is required for Socket Mode SocketModeHandler(app, os.environ.get("SLACK_APP_TOKEN", "")).start()
Debug
Known issues
breakingPython 3.6 support has been officially dropped. Applications running on Python 3.6 will need to upgrade to Python 3.7 or newer.
fix
Upgrade your Python environment to 3.7 or later. The `requires_python` metadata is `^3.7`.
affects: >=1.25.0
gotchaDeployment strategies differ significantly for local development versus production. `App.start()` or `SocketModeHandler` is for local Socket Mode development. For production, you must use an HTTP adapter (e.g., `FlaskResponder`, `AwsLambdaPythonReceiver`) and expose an endpoint for Slack to send events.
fix
For production, use `AsyncApp` with an appropriate HTTP adapter (e.g., `from slack_bolt.adapter.flask import FlaskResponder`) and deploy to a web server capable of handling HTTP requests from Slack. Consult the official Bolt documentation on deployment.
affects: all
gotchaAll Slack apps require careful configuration within api.slack.com/apps, including setting correct OAuth Scopes, enabling Event Subscriptions, and verifying the Slack Signing Secret. Many errors (e.g., 401 Unauthorized, events not being received) stem from misconfigurations or missing environment variables.
fix
Double-check your Slack App's Basic Information, OAuth & Permissions, Event Subscriptions, and Interactivity & Shortcuts settings on api.slack.com/apps. Ensure `SLACK_BOT_TOKEN`, `SLACK_SIGNING_SECRET`, and `SLACK_APP_TOKEN` (for Socket Mode) are correctly set in your application's environment variables.
affects: all
gotchaNew AI-enabled features like `say_stream` and `set_status` (for streaming messages and showing loading states) introduced in v1.26.0 and v1.28.0 require specific Bolt versions and may depend on the latest Slack platform features. If these methods are not available or behave unexpectedly, check your Bolt version and Slack app setup.
fix
Upgrade `slack-bolt` to the latest version (e.g., `pip install --upgrade slack-bolt`). Ensure your Slack App has the necessary permissions and features enabled on the Slack API dashboard, especially if using beta or experimental AI capabilities.
affects: <1.26.0
Errors
Common errors & fixes
Signature verification failed
The `SLACK_SIGNING_SECRET` environment variable is either missing, incorrect, or doesn't match the one configured for the Slack app, preventing the Bolt app from verifying the authenticity of incoming requests.
fix
Ensure the `SLACK_SIGNING_SECRET` environment variable is set correctly and matches the signing secret from your Slack app's 'Basic Information' page.
ModuleNotFoundError: No module named 'slack_bolt'
The `slack-bolt` library has not been installed in the Python environment where the script is being executed.
fix
Install the library using pip: `pip install slack-bolt`
slack_sdk.errors.SlackClientConfigurationError: Missing 'token' in arguments
The Slack bot token (`SLACK_BOT_TOKEN`) is either missing from environment variables, or not passed correctly during the `App` initialization or when making a direct `client` call.
fix
Ensure the `SLACK_BOT_TOKEN` environment variable is set with your bot user OAuth token (starts with `xoxb-`), or explicitly pass `token='YOUR_BOT_TOKEN'` when initializing `App` or `WebClient`.
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://slack.com/api/chat.postMessage, status: 403, code: missing_scope)
The bot token used by the `slack-bolt` app lacks the necessary Slack API scopes (permissions) to perform the requested operation.
fix
Go to your Slack app's configuration (api.slack.com/apps), navigate to 'OAuth & Permissions', add the required scopes (e.g., `chat:write`), and reinstall the app to your workspace.
Upgrade
Version history
1.30.0latest on PyPI · released Jul 15, 2026
Audit
Dependencies
python-dotenvoptionalCommonly used for loading environment variables in local development.
Agent activity
21 hits · last 30 days
node
16
OpenAI (training)
1
Resources
slack-bolt — pip install slack-bolt · libregistry