This project aims to integrate RedwoodJS, Netlify, and Slack Bolt JS for building Slack applications.
-
Fork this repository: redwoodjs-project.
-
Go to your Netlify account and create a new site. Authorize Netlify to access your forked repository and deploy the site.
-
After deploying, go to "Site Settings" and navigate to "Environment Variables."
-
Click the "Add variable" button, then select "Import from a .env file."
-
Paste the following content and fill in the variables:
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
SLACK_SIGNING_SECRET=
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
You can find the Slack variables in your Slack app's API dashboard under "Settings" > "Basic Information."
For Upstash environment variables, create a new Redis database and generate the keys at Upstash Console.
- After adding the variables, click the "Import variables" button.
- In your Netlify site, go to "Deploys" and trigger a new deploy by clicking "Deploy site again."
- Configure your Slack app to receive events and interact correctly. Go to your Slack app dashboard and select "Event Subscriptions."
- Activate events and set the request URL to the following:
https://{YOUR_NETLIFY_SITEID}.netlify.app/slack/events
Verify the URL, and it should be successfully verified.
-
Make sure to add at least one permission in "Subscribe to bot events," then save the changes.
-
Next, go to "Interactions & Shortcuts" and configure the request URL to the same URL as for events:
https://{YOUR_NETLIFY_SITEID}.netlify.app/slack/events
- Finally, in "OAuth & Permissions," configure the following Redirect URL and save it:
https://{YOUR_NETLIFY_SITEID}.netlify.app/slack/oauth_redirect
Now, your Slack app is properly configured to interact with your application.
1.Install the app in your Slack workspace by visiting:
https://{YOUR_NETLIFY_SITEID}.netlify.app/slack/install
- Grant the necessary permissions, and if everything goes well, you should receive a JSON response:
{
"message": "Access token stored successfully."
}
Congratulations! Your app is now installed in your Slack workspace.