Create a Slack App
Add Slash Command
With your app created, you can define a slash command.
- Navigate to "Slash Commands" and click "Create New Command".
- Fill out the form using the deployed URL for your function.
- Hit "Save".
Add To Workspace
Navigate back to "Basic Information" click "Install App to Workspace". Make note of the Verification Token. We need to add this as an environment variable.
Add Environment Variable
To securely access the API, we need to include the secret with each request. We also do not want to commit secrets to git. Thus, we should use an environment variable. Learn how to add environment variables in Vercel.