Blockkit is a Python library for building user interfaces for Slack apps. It provides a fluent API with type hints and validation, allowing developers to compose Slack's Block Kit elements using Python classes, which reduces boilerplate and improves maintainability. The library is currently at version 2.1.3 and is actively maintained with frequent releases.
pip install blockkitVerified import paths — ran on the pinned version, not inferred.
This example constructs a Slack message with an approval request, including a button with a confirmation dialog. The `.build()` method validates the Block Kit structure, ensuring compliance with Slack's API specifications. The generated `message` object can be directly passed to the `blocks` parameter of `slack_sdk.WebClient.chat_postMessage`.
Rewrite Block Kit UI construction using the new fluent API. Refer to the official documentation for migration guidance and new syntax.
Configure the 'Request URL' in your Slack App settings (api.slack.com/apps) under 'Interactivity & Shortcuts'. Ensure your server endpoint correctly receives and processes Slack's `POST` requests.
Refer to Slack's 'Formatting text for app surfaces' documentation for exact 'mrkdwn' syntax. Blockkit's automatic detection usually works, but manual review for complex formatting may be needed.
Ensure all Blockkit components are correctly instantiated and chained according to the library's fluent API. The `.build()` method performs validation; check its output for detailed errors. Use Block Kit Builder (api.slack.com/tools/block-kit-builder) to prototype and validate your structure.
Verify that your Slack App's 'Interactivity & Shortcuts' 'Request URL' is correctly set and your server is publicly accessible. Also, ensure interactive elements in your Blockkit structure are properly nested within `Actions` blocks or `Input` blocks configured to dispatch actions.
No dependency data recorded yet.