{"id":24600,"library":"slackeventsapi","title":"Slack Events API Python Adapter","description":"A Python adapter for the Slack Events API, built on Flask. It handles event verification, parsing, and dispatching for incoming Slack events. The current version is 3.0.3, requiring Python >=3.6 and Flask 2.x. Releases are irregular as the library is in maintenance mode.","status":"active","version":"3.0.3","language":"python","source_language":"en","source_url":"https://github.com/slackapi/python-slack-events-api","tags":["slack","events-api","flask","adapter"],"install":[{"cmd":"pip install slackeventsapi","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for handling HTTP requests and event routing.","package":"flask","optional":false},{"reason":"Used for event emitter pattern; v3.0.3 pins max version due to breaking changes.","package":"pyee","optional":false},{"reason":"Used for verifying signing secrets and outgoing requests.","package":"requests","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"SlackEventAdapter","correct":"from slackeventsapi import SlackEventAdapter"},{"note":"","wrong":null,"symbol":"verify_signature","correct":"from slackeventsapi import verify_signature"}],"quickstart":{"code":"import os\nfrom flask import Flask\nfrom slackeventsapi import SlackEventAdapter\n\napp = Flask(__name__)\nslack_signing_secret = os.environ.get('SLACK_SIGNING_SECRET', '')\nslack_events_adapter = SlackEventAdapter(slack_signing_secret, \"/slack/events\", app)\n\n@slack_events_adapter.on(\"app_mention\")\ndef handle_app_mention(event_data):\n    print(\"App mentioned:\", event_data)\n    return \"OK\"\n\nif __name__ == \"__main__\":\n    app.run(port=3000)\n","lang":"python","description":"Minimal Flask app using SlackEventAdapter to respond to app_mention events."},"warnings":[{"fix":"Upgrade Python to 3.6+ and Flask to 2.x.","message":"In v3.0.0, dropped support for Python 2.7 and Flask 1.x. Ensure your environment uses Python >=3.6 and Flask >=2.0.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Migrate to slack_bolt: https://github.com/slackapi/bolt-python","message":"The library is in maintenance mode; no new features are planned. Slack recommends using Bolt for Python (slack_bolt) for new projects.","severity":"deprecated","affected_versions":"all"},{"fix":"Offload processing to a background thread or queue. See GitHub issue #84.","message":"Event acknowledgements must be sent within 3 seconds. Long-running handler blocks the response; use threads or async to avoid timeout.","severity":"gotcha","affected_versions":"all"},{"fix":"Update your app to use Signing Secret from Slack app settings. Pass signing_secret instead of verification_token.","message":"In v2.0.0, switched from Verification Token to Signing Secret. Old code using Verification Token will fail.","severity":"breaking","affected_versions":"<2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip uninstall slackeventsapi && pip install slackeventsapi. If still fails, check the package version: import slackeventsapi; print(slackeventsapi.__version__)","cause":"The package is installed but not correctly imported; or version does not export that name.","error":"ImportError: cannot import name 'SlackEventAdapter' from 'slackeventsapi'"},{"fix":"Pass your Slack app's signing secret: SlackEventAdapter('your_signing_secret', '/events', app)","cause":"The first argument to SlackEventAdapter is now signing_secret (required in v2.0+).","error":"TypeError: __init__() missing 1 required positional argument: 'signing_secret'"},{"fix":"Double-check SLACK_SIGNING_SECRET environment variable. Ensure server time is accurate (NTP). If behind a proxy, forward original headers.","cause":"Request signature verification failed. Usually due to misconfigured signing_secret or clock drift.","error":"slackeventsapi.exceptions.SlackRequestVerificationFailed: Invalid request signature"},{"fix":"Ensure your route returns a plain text response with the challenge value. Using SlackEventAdapter automatically handles it.","cause":"The event URL verification endpoint returns unexpected body or status code.","error":"Challenges are not matched and the URL verification fails"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}