Slack Spring Boot Starter

by kreait

GitHub Readme.md

Slack Spring Boot Starter Heroku

Quickstart

Preparation

1. Create a new Slack App

Head over to https://api.slack.com/apps and create your new Slack App.

2. Set up your Slack App

There is no right order to do this. If you know what your future Heroku instance will be named, you can progress this guide step-by-step. Let's assume your Heroku instance will hold the name slackboot.

  1. Enable Incoming Webhooks

  2. Enable Interactive Components
    The Request-URL will be https://slackboot.herokuapp.com/interactive-components

  3. Adding Slash Commands:
    Create a new Slash Command with these parameters:

    • Command: /rock-paper-scissors
    • Request URL: https://slackboot.herokuapp.com/commands
    • Short Description: Play Rock Paper Scissors
    • Usage Hint: optional
  4. Adding a Bot User:
    You can chose whatever you like for the Display name and default name.

  5. OAuth & Permissions - adding a Redirect URL & Managing Scopes:

    This step is important since you have to install the App in order to get a Team-ID that is needed to use the Slack App (for authentication purposes). In our case, since we chose slackboot as a name, our Redirect URL will be https://slackboot.herokuapp.com/installation.

    In the same menu, add the following Permission Scopes:

    • chat:write:bot
    • incoming-webhook

Now hit Install App to Workspace and you will get the following (sensitive) information about your Slack App:

- The OAuth Token
- The Client-ID
- The Client-Secret
- The Signing-Secret

Since you will be prompted to enter these while deploying on Heroku. Additionally you’ll need to have the following settings in your Slack-App Configuration:

  • Event Subscriptions: channel.message
  • Slash Commands: /rock-paper-scissors with {ngrok_host}/commands
  • OAuth Scope: channels:read and channels:write

Deploy to Heroku

After the preparations are made, you can deploy your App on Heroku.

Deploy

After deploying, go to https://api.slack.com/apps - select your app - go to Manage Distribution and hit Add to Slack to finalize your installation.

Support

Feel free to join our Discord - We are happy to help!