Sample Slack app that presents a Terms of Service (or any other message) when a new user joins a team.
The user can accept the Terms of Service using message buttons. If a user has been presented with the Terms before and they haven't accepted, a background job can send them a reminder after a specific period of time. Eventually you can use the SCIM API to disable the user's account.
- Create an app at api.slack.com/apps
- Navigate to the Bot Users page and add a bot user
- Navigate to the Install App page and install the app
- Copy the
xoxb-
token after the installation process is complete
- Get the code
- Either clone this repo and run
npm install
- Or visit https://glitch.com/edit/#!/remix/slack-terms-of-service-blueprint
- Either clone this repo and run
- Set the following environment variables to
.env
(see.env.sample
):SLACK_TOKEN
: Your app'sxoxb-
token (available on the Install App page)SLACK_VERIFICATION_TOKEN
: Your app's Verification Token (available on the Basic Information page)PORT
: The port that you want to run the web server on
- If you're running the app locally:
- Start the app (
npm start
) - In another windown, start ngrok on the same port as your webserver (
ngrok http $PORT
)
- Start the app (
- Go back to the app settings and click on Events Subscriptions
- Set the Request URL to your ngrok or Glitch URL + /events
- On the same page, subscribe to the
team_join
team events
- In the app settings, click on Interactive Messages
- Set the Request URL to your ngrok or Glitch URL + /interactive-message