Skip to main content
Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

Explore the Bolt Development Framework

Learning Objectives 

In this project, you’ll:

  • Set up a Slack developer sandbox.
  • Build a Slack app using Glitch.
  • Enable your Slack app to read and write messages.
  • Deploy your Slack app.
  • Build simple interactivity for your Slack app.

What You’ll Need

In this project, you’ll build an app using the Slack Bolt for JavaScript framework. You’ll use several environments and tools (which you’ll sign up for if you don’t already have access), including:

  • Your very own free Trailhead Slack Developer sandbox.
  • The Slack development site, api.slack.com.
  • Glitch, a free, convenient development and hosting environment.
  • A text editor where you can paste and save several tokens and strings.

Aside from the text editor, we’ll help get you set up with what you need. Let’s start by getting to know Bolt!

Get to Know Bolt

Bolt is a development framework that makes it easier to build Slack apps with Slack’s latest platform features. It uses a listener interface that enables common patterns when handling requests coming from Slack, regardless of the type. In this project, you use the Bolt for JavaScript framework to build your app.

Bolt has a number of built-in defaults like OAuth support, verification of events, and a simplified interface for features like workflow automation. This project provides an overview of Slack’s APIs, Bolt’s listener patterns, and the creation of a Bolt for JavaScript app.

Slack APIs at a Glance

Before building with Bolt, it’s helpful to have a high-level understanding of application programming interfaces (APIs). If you aren’t familiar with APIs, we highly recommend checking out the API Basics module to give you a better foundation for how your app works.

Slack apps have access to a range of APIs that enable them to read, write, and update data in Slack. The two most commonly-used APIs for apps are the Web API and Events API. Slack uses the Events API to send your app an event. Your app uses the Web API to send an interaction back to Slack.

Events API

The Events API uses event subscriptions to send JSON payloads to your app via HTTP. When your app receives an event, it acknowledges the payload and decides what action to take. Events can be anything happening inside of a workspace—a message posted in a channel, a user opening your app’s home tab, or a new user joining the workspace. The full Events API types list can be found on the Slack API site.

Bolt includes built-in helpers to receive and route events to your app’s listeners, and expose helpful information like the workspace and relevant users or channels. These helpers ensure your app works as it should, interacting with people in the right places, at the right time. Listeners are covered later in this project.

Web API

The Web API is a collection of HTTP methods with similar calling conventions to interact with API object types in Slack, like channels, conversations, events, and more. These interactions include sending rich, interactive messages to a channel or other app surface, or querying for workspace information like a list of users. The full list of Web API methods can be found on the Web API methods page. Bolt includes a built-in client with features like rate limit handling and retry logic to simplify calling and handling responses of Web API requests. 

And for niche use cases like administering a workspace or performing security audits, additional APIs can be found in the documentation.

Sign Up for the Slack Developer Program

To complete this project, you need to create a new Slack development environment. To do so, sign up for the Slack Developer Program. If you’ve already done so, go ahead and skip to the next section.

  1. Sign up for the free Slack Developer Program.
  2. Enter your information. We recommend entering a personal email in the Email address field where you will receive messages and links from the Slack Developer Program.
  3. Check the box for I agree to Slack’s Privacy Policy, API Terms of Service, and Developer Program Agreement.
  4. Then, click SUBMIT. Slack will send you an activation email.
  5. Open the email prompting you to activate your Slack developer account.
  6. Click ACTIVATE DEVELOPER ACCOUNT. When you click the button, you’re taken back to the developer program with a welcome message.
    Welcome to the Slack Developer Program! modal
  7. Click Get started.

You’re in! You can do a lot via the Slack developer program, including accessing developer documentation, videos, and webinars. You can view API changelogs and more.

Retrieve Your Trailhead Slack Developer Sandbox

Trailhead provides you with a special Slack Developer Sandbox. While you can provision sandboxes manually via the Slack developer program, the one you get for Trailhead is specially made for hands-on learning. Let’s launch your playground.

  1. Scroll to the bottom of this page.
  2. Click Connect Slack Playground.
    1. If you get a Hi, Trailblazer! Welcome to the Slack Developer Program message, click Sign In.
  3. Enter the email you used when you signed up for the Slack Developer Program.
  4. Then, click Sign in. Slack sends you a confirmation code via email.
  5. Retrieve your code and enter it to finish connecting your sandbox.
    1. If you get a message asking you to agree to terms and services, go ahead and click Agree.
  6. It may take a moment, but you’re brought back to Trailhead. Go to the bottom of the page and the Challenge box shows the sandbox has been provisioned for you and connected.
  7. Click Launch to have your playground opened in a new tab.
    1. If this is your first time launching your playground, you may see a modal to accept terms of service once more. Click I agree.

Let’s head into your playground!

Create a New Channel

Here’s a scenario—you’re the go-to developer for Slack apps at your organization. The onboarding team recently approached you. They want to have an automated and fun way of welcoming new team members. You sit with the team and go over the requirements and it sounds like a simple app is the way to go. But you already know, simple doesn’t necessarily mean easy.

You review your notes. New team members need a channel to gather and get the information they need. That’s where the app will interact with them.

  1. In your Slack Playground, Click + next to Add channels.
  2. Click Create a new channel.
    modal open under + Add channels and Create a new channel is highlighted.
  3. Name your channel welcome-new-team-members
  4. Click Next.
  5. Ensure the channel Visibility is set to Public.
  6. Click Create.
  7. If Slack asks you to add people to the channel, click Skip for now.

#welcome-new-team-members channel is selected and open in Slack.

You now have a channel dedicated to welcoming new team members. This is where the onboarding team can make announcements and host Q&A events to get people up to speed. It’s where your new app does most of its work. In the next step, you’ll create your app and give it the right scopes so your people can interact with it.

Verify Step

+100 points

You’ll be completing this project in your own Slack Playground.

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback