This tutorial is meant to guide developers through setting up and configuring a Slack app for local development.
Feel free to skip around to the specific sections relevant to you — we won’t mind 🙂
Head over to our Bolt JS Getting Started Guide’s section “Create an App” for the latest up-to-date instructions on how to create a new app on api.slack.com/apps.
Head over to our Bolt JS Getting Started Guide’s section “Tokens and installing apps” for the latest up-to-date information on what tokens are, the different kinds of tokens available, how to create them on api.slack.com/apps, how to install your app to a live Slack workspace and finally how to retrieve your access token.
Your app can communicate with Slack using one of two methods:
This tutorial will cover how to set up your app using either approach.
Setting up your Node.js application for Socket Mode development is fast and easy with the
Once you’ve created an app, you will need to generate an App Token. On your app’s page on api.slack.com/apps, under the main Basic Information page, scroll down to App-Level Tokens. Click Generate Token and Scopes, add a name for your app token, and click Add Scope. Choose
connections:write and then click Generate. Copy and safely store the generated token - you’ll need that when following the Socket Mode package setup instructions.
A Request URL is a public URL where Slack can send HTTP POST requests with information about events, interactions and other happenings inside your Slack workspace.
For example, when a message is posted, a button is clicked, a dialog is submitted, or a user interacts with your app using another interactive feature, Slack will send relevant information about that event to your app’s Request URL such as the user who initiated the event, channel where the event occurred and other contextual details.
If you’re just getting started with your app development, you probably don’t have a publicly accessible URL yet. Eventually, you’ll want to set that up, but for now a development proxy like ngrok will do the job.
Once you’ve installed a development proxy, run it to begin forwarding requests to a specific port (we’re using port 3000 for this example):
ngrok http 3000
The output should show a generated URL that you can use (Use the one that starts with
https://). This URL will be the base of your request URL, in this case
At this point you have a public-facing URL. Now, let’s add that to the Interactivity and Shortcuts and Events Subscriptions page. Under the Request URL box, go ahead and paste in your accessible URL.
If you want your app to be subscribed to workspace events (like when a reaction is added, when a user mentions your app, or another Events API event, you need to enable events for your app.
Start by clicking Event Subscriptions on the left sidebar. If your app is using HTTP to communicate with Slack, after you toggle the switch, you’ll need to add a Request URL. This is similar to adding a Request URL in the Interactive Components section, but as described on this page, Slack will issue a
challenge request to verify that your app’s request URL can respond appropriately to incoming requests. Read through our Request URL Configuration & Verification documentation for details on how to properly handle a
On the Event Subscriptions page, you can add each event you want your app to subscribe to. In the tables below, you may add Workspace events and Bot events.
Most events require additional scopes (for example, the
reaction_added event requires the
reactions:read scope). You can add scopes to your app on the OAuth & Permissions page.
Once you’ve selected all the event types, be sure to Save Changes.
Lastly, if you’ve added event types that require scopes your app did not previously have, you’ll need to reinstall the app into the workspace(s) you’d like Slack to send your app new events. You can reinstall the app from the Install App page.
Hopefully this guide included information that’s helpful to get you up and running with a Slack app. If something is missing, feel free to open a ticket or a pull request.
The different packages have code samples, explanations, and more resources to get you started writing the code in your app using our SDKs. The README has links to the packages and examples to get started.