Build a Javascript Slack App

A Summary of the Official Building a Bolt JS App

  1. Create a new slack app in the apps portal.
  2. Go to Basic Information page in the apps portal and install the app in your Slack instance.
  3. To edit and host the code for your slack app: Create a Glitch app from Slack’s template.
  4. Copy the signing secret and the Bot token from Basic Information and OAuth pages in the apps portal into your glitch app’s .env file.
  5. Go to Event Subscriptions in the apps portal and add app_home_opened.
    1. request_url for glitch apps is https://YOUR_APP_NAME.glitch.me/slack/events.
    2. Add bot event app_home_opened. Save changes.
  6. Go to your app’s “home” page in the Slack app. You should see the example text and button from the code in Glitch.
  7. You can now use shortcuts, listen for events, post messages, and more with the bolt js framework. To try one, just replace the example “app.home.opened” function.
  8. Each of the functions above has listener functions for interacting with Slack. 

Add a Shortcut in a Bolt JS Slack App

  1. Go to your app’s Interactivity page in the apps portal.
    1. request_url for glitch apps is https://YOUR_APP_NAME.glitch.me/slack/events.
    2. Name is whatever you want showing up in the Slack app.
    3. callback_id is your function name that you will use in your code.
  2. In glitch, add the code from https://slack.dev/bolt-js/concepts#shortcuts.
  3. That’s it. To add more functionality to your shortcut, check out https://github.com/slackapi/bolt-js#making-things-happen.
slack shortcut example
slack shortcut example