The slack integration allows you to automatically send responses to a Slack channel of your choice.
If you are on a self-hosted instance, you will need to configure this integration separately. Please follow the guides here to configure integrations on your self-hosted instance.
Before the next step, make sure that you have a Formbricks Survey with at least one question and a Slack channel in the Slack workspace you integrated.
Congratulations! You have successfully linked a Slack channel with Formbricks. Now whenever a response is submitted for the linked survey, it will be automatically sent to the linked Slack channel.
Enabling the Slack Integration in a self-hosted environment requires a setup using slack workspace account and changing the environment variables of your Formbricks instance.
If you are running Formbricks locally:
You need to use https
instead of http
for the redirect URI.
You can update the go
script in your apps/web/package.json
to include the --experimental-https
flag. The
command will look like:
You also need to update the .env file in the apps/web
directory to include the WEBAPP_URL
as https://localhost:3000
instead of http://localhost:3000
.
You also need to run the terminal in admin mode to run the go
script(to acquire the SSL certificate). You can do this by running the terminal as an administrator or using the sudo
command in Unix-based systems.
Create a Slack workspace if you don’t have one already.
Go to the Your apps page and Create New App.
Click on From Scratch and provide the App Name and select your workspace in Pick a workspace to develop your app in: dropdown. Click on Create App.
Go to the OAuth & Permissions tab on the sidebar and add the following Bot Token Scopes:
channels:read
groups:read
chat:write
chat:write.public
chat:write.customize
Add the Redirect URLs under OAuth & Permissions tab. You can add the following URLs:
If you are running formbricks locally, you can enter https://localhost:3000/api/v1/integrations/slack/callback
.
Or, you can enter https://<your-public-facing-url>/api/v1/integrations/slack/callback
Now, click on Install to Workspace and Allow the permissions.
Go to the Basic Information tab on the sidebar and copy the Client ID and Client Secret. Copy them and set them as the environment variables in your Formbricks instance as:
SLACK_CLIENT_ID
- OAuth Client ID
SLACK_CLIENT_SECRET
- OAuth Client Secret
Now, you need to enable the public distribution of your app. Go to the Basic Information tab and click on the Manage distribution button and click on the “Distribute App”.
Scroll down to the Share your app with other workspaces section, complete the checklist and click on the Activate public distribution button.
SLACK_CLIENT_ID
SLACK_CLIENT_SECRET
Voila! You have successfully enabled the Slack integration in your self-hosted Formbricks instance. Now you can follow the steps mentioned in the Formbricks Cloud section to link a Slack workspace with Formbricks.
To remove the integration with Slack Workspace,
Visit the Integrations tab in your Formbricks Cloud dashboard.
Select “Manage” button in the Slack card.
Click on the “Delete Integration” button.
It will now ask for a confirmation to remove the integration. Click on the “Delete” button to remove the integration. You can always come back and connect again with the same Slack Workspace.
Still struggling or something not working as expected? Join our Github Discussions and we’d be glad to assist you!