Configure Facebook Messenger integration for Chatwoot
To use Facebook Channel, you have to create a Facebook app in the developer portal. You can find more details about creating Facebook apps here.
Once you register your Facebook App, you will have to obtain the App Id
and App Secret
. These values will be available in the app settings and will be required while setting up Chatwoot environment variables.
Configure the following Chatwoot environment variables with the values you obtained during the Facebook app setup. The FB_VERIFY_TOKEN
should be a unique and secure string that you provide when configuring the Facebook app. Generate a random string and set it as the FB_VERIFY_TOKEN
. Facebook will include this string in all verification requests.
Restart the Chatwoot server after updating the environment variables
Web OAuth Login
, Login with Javascript SDK
and add your self-hosted domain to the Allowed Domains for the JavaScript SDK
input.Chatwoot installation domain
as your app domain.{your_chatwoot_installation_url}/bot
and the Verify token as FB_VERIFY_TOKEN
from your environment variable.Until the application is approved for production, Facebook wouldn’t send the new messages on your page to Chatwoot.
To test the changes until the app is approved for production. Follow the steps
Add or remove pages
and connect the page which you choose while creating the Chatwoot Messenger inbox.Add subscriptions
from the connected page.Before you can start using your Facebook app in production, you will have to get it verified by Facebook. Refer to the docs on getting your app verified.
Obtain advanced access to the required permissions mentioned below for your Facebook app
Make sure your facebook app subscription version is 17.0, we have updated the FB subscription with the latest version, so change the permission subscription version under the facebook app webhooks option.
Install ngrok on your machine. This will be required since Facebook Messenger API’s will only communicate via https.
Configure ngrok to route to your Rails server port.
Go to the Facebook developers page and navigate into your app settings. In the app settings, add localhost
as your app domain.
In the Messenger settings page, configure the callback url with the following value.
Update verify token in your Chatwoot environment variables.
You will also have to add a Facebook page to your Access Tokens
section in your Messenger settings page.
Restart the Chatwoot local server. Your Chatwoot setup will be ready to receive Facebook messages.
We support facebook API version v13.0 going forward, which you can update in the facebook app advanced settings.
/bot
endpoint in your ngrok screen.