Skip to main content

Build Slack Apps with Bolt

Learning Objectives

After completing this unit, you’ll be able to:

  • Locate and recommend when to use sample code, tools, and resources.
  • Recommend when to use Bolt to build Slack apps.

In this module, you learn about Bolt, the official Slack development framework that lets you build apps quickly. You review first-party software development kits (SDKs), frameworks, and construction tools to help bring your designs to life. You also review libraries, documentation, code samples, tutorials, and guides that help you build your designs with more efficiency and ease.

Meet Bolt

Bolt wraps modern platform features and APIs, and includes built-in app and server configurations, token validation, and type support. Bolt is available for Java, JavaScript, and Python.

Bolt provides simple interfaces for some of the most common app features, such as constructing messages, sending web API calls, listening for event callbacks, and handling interactivity. Bolt simplifies what you'd build with first-party SDKs and OAuth helpers, freeing you to focus on design.

You can even use the Slack command line interface (CLI), discussed more in unit 2, to streamline development of apps using Bolt for JavaScript and Bolt for Python.

You don’t need to use Bolt, but it makes things easier. Bolt builds upon the languages’ respective SDKs to provide you with an application framework that allows you to build Slack apps as quickly as possible. Said another way, Bolt is a “batteries-included” framework for building apps.

First-Party SDKs

Save precious development time by using the official Slack SDKs. The Java and JavaScript (via NodeJS) and Python SDKs provide in-language wrappers for the most commonly used functions to build and use apps on the Slack platform. If you’re developing a Slack app in one of these three languages, we strongly recommend you start with these first-party SDKs. Slack keeps these up to date to support the latest platform features.

If you prefer to build the foundations of your app yourself, you can still use an SDK to cut down on boilerplate code. Instead of building your own authentication, or handling manual generation of HTTP requests for Web API calls, just use built-in SDK classes and methods.

Slack provides open-source SDKs that are hosted on GitHub. Slack always welcomes your feedback and contributions.

Learn more about our first-party SDKs and Slack Platform Developer Tools. And if you’re just getting started, learn more about Bolt for JavaScript, Java, and Python.

App Blueprints

App blueprints are guides that detail procedures for handling common app functions. You can check out the app blueprints for approval flows, notification, and account binding, among other goals. Each application blueprint includes comprehensive instructions, code samples, and a helpful flow diagram.

App blueprints are hosted on GitHub, and are available at no extra cost.

Learn more about the available Slack app blueprints.

In addition to first-party SDKs and resources, Slack provides utilities to help you develop your apps. Check out two of these tools: Block Kit and Slack Developer Tools.

Block Kit

Block Kit is a UI framework that offers control and flexibility for messages, modals, and App Home surfaces in Slack.

Block Kit surfaces are composed of one or more blocks that are stackable segments of UI (think text, images, inputs, and so forth) for which you can customize the arrangement and appearance. Block Kit is ultimately represented using JSON-formatted payloads that your app sends to Slack in an HTTP request.

Learn more about Block Kit and its blocks, app templates, and documentation.

Block Kit Builder

Quickly prototype app interactions, select blocks, and edit the raw payloads as you go.

Block Kit Builder makes it easier for you and your application stakeholders to experiment with generating Block Kit payloads. You can work from templates and send your creations to Slack for testing and gathering feedback from your team. For example, you might preview a message across desktop and mobile clients before sending it to Slack.

Arrange and stack blocks to quickly prototype layouts in Slack. When you're ready, Block Kit Builder provides you the JSON payload. All you have to do is add it into your app's code.

Try It Out

One of the best ways to learn about Block Kit Builder is to head over to the tool and explore what it can do.

  • Review predefined templates for inspiration.
  • Switch surface previews between messages, modals, and App Home.
  • Switch between desktop and mobile client, and light and dark modes, to preview how your creation displays depending on how users have Slack set up.
  • Use the Send to Slack button in the toolbar to test how your message, modal, or App Home displays in Slack.

Slack Developer Tools

Slack Developer Tools, or SDT for short, is a Slack app that helps developers inspect message payloads. It also finds useful information such as API documentation, platform status, and IDs for users, workspaces, and Enterprise+ orgs.

SDT includes several entry points including App Home, message shortcuts, and a slash command.

With SDT, you can quickly access Slack API documentation (via the /sdt slash command) and inspect code behind messages (via the "inspect" action), without leaving your Slack workspace. Additional SDT slash commands include:

  • /sdt docs [method name]: Get a brief overview of the given method.
  • /sdt test_webhook [webhook url]: Send a test payload to a Slack webhook URL.
  • /sdt help: Get a list of commands and support information for using SDT.
Note

Design Tip

Select the Inspect message shortcut in SDT to examine the Block Kit JSON payload used to construct the message.

Note that Slack Developer Tools is available to any user on a workspace where the SDT app is installed.

Resources

Comparta sus comentarios sobre Trailhead en la Ayuda de Salesforce.

Nos encantaría conocer su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios cuando quiera desde el sitio de la Ayuda de Salesforce.

Más información Continuar para compartir comentarios