diff --git a/docs.json b/docs.json index 7b929bd8..b43d3a91 100644 --- a/docs.json +++ b/docs.json @@ -135,6 +135,7 @@ "self-hosted/configuration/features/integrations/facebook-channel-setup", "self-hosted/configuration/features/integrations/instagram-channel-setup", "self-hosted/configuration/features/integrations/instagram-via-instagram-business-login", + "self-hosted/configuration/features/integrations/whatsapp-embedded-signup", "self-hosted/configuration/features/integrations/slack-integration-setup", "self-hosted/configuration/features/integrations/linear-integration-setup", "self-hosted/configuration/features/integrations/shopify-integration-setup" diff --git a/self-hosted/configuration/features/integrations/whatsapp-embedded-signup.mdx b/self-hosted/configuration/features/integrations/whatsapp-embedded-signup.mdx new file mode 100644 index 00000000..3368a9ab --- /dev/null +++ b/self-hosted/configuration/features/integrations/whatsapp-embedded-signup.mdx @@ -0,0 +1,176 @@ +--- +title: WhatsApp Embedded Signup +description: Set up WhatsApp integration using Meta's streamlined embedded signup flow +sidebarTitle: WhatsApp Embedded Signup +--- + +WhatsApp Embedded Signup enables users to connect their WhatsApp Business accounts through Meta's streamlined OAuth flow without manual webhook configuration. This significantly improves the user experience by automating the entire setup process. + +## Prerequisites + +1. A valid Facebook account +2. A WhatsApp Business account (or ability to create one) +3. Admin access to your Chatwoot installation + +## Super Admin Configuration + +Before users can use WhatsApp Embedded Signup, administrators must configure the following environment variables via the Super Admin panel at `/super_admin/app_config?config=whatsapp_embedded`: + +- **WHATSAPP_APP_ID**: The Facebook App ID for WhatsApp Business API integration +- **WHATSAPP_CONFIGURATION_ID**: The Configuration ID for WhatsApp Embedded Signup flow (obtained from Meta Developer Portal) +- **WHATSAPP_APP_SECRET**: The App Secret for WhatsApp Embedded Signup flow (required for token exchange) + + +These settings must be configured by a Super Admin before the WhatsApp Embedded Signup option becomes available to users. + + +### Retrieving Configuration Values from Meta Developer Portal + +To obtain the required configuration values: + +#### 1. Create or Access Your Facebook App + +1. Go to [Meta for Developers](https://developers.facebook.com/) +2. Click on "My Apps" in the top navigation +3. Either select an existing app or click "Create App" +4. If creating a new app: + - Choose "Business" as the app type + - Select "Business" for "I want to connect my app to" + - Provide app details (name, email, business portfolio) + +#### 2. Configure WhatsApp Product + +1. In your app dashboard, click "Add Product" +2. Find "WhatsApp" and click "Set Up" +3. Accept the WhatsApp Business Terms + +#### 3. Retrieve App ID and App Secret + +- **App ID**: Found at the top of your app dashboard or in Settings → Basic +- **App Secret**: Located in Settings → Basic (click "Show" and authenticate to reveal) + + +#### 4. Obtain Configuration ID + +1. Navigate to WhatsApp → Configuration in the left sidebar +2. Under "Embedded signup", click "Configure" +3. Set up the configuration: + - **Callback URL**: `https://your-domain.com/webhooks/whatsapp/{phone_number_id}` + - **Success URL**: `https://your-domain.com/app/accounts/{account_id}/settings/inboxes/new/whatsapp_cloud` + - **Cancel URL**: `https://your-domain.com/app/accounts/{account_id}/settings/inboxes/list` +4. Save the configuration +5. Copy the generated **Configuration ID** + + +**Important:** Before overriding the current callback URI, your app must be subscribed to receive messages for the WhatsApp Business Account. This prevents error (#100) during webhook configuration. Ensure the messages webhook field is subscribed in your app's webhook settings. + + + +#### 5. Required Permissions + +Ensure your app has the following permissions enabled: + +- `whatsapp_business_management` - Manage WhatsApp business assets +- `whatsapp_business_messaging` - Send and receive WhatsApp messages +- `business_management` - Manage business assets + + + +For production use, your app may need to go through App Review to get advanced access to certain features. The embedded signup flow works with Standard Access for most use cases. + + +## Creating a WhatsApp Channel + +### Step 1: Navigate to Channel Selection + +1. Go to Settings → Inboxes in your Chatwoot dashboard +2. Click on "Add Inbox" +3. Select WhatsApp from the channel options + +![whatsapp_channel_selection](/self-hosted/images/whatsapp/whatsapp_channel_selection.png) + +### Step 2: Choose WhatsApp Cloud + +Select "WhatsApp Cloud" for the quick setup through Meta (embedded signup). + +![whatsapp_provider_selection](/self-hosted/images/whatsapp/whatsapp_provider_selection.png) + +### Step 3: Start Embedded Signup + +Click on "Connect with WhatsApp Business" to begin the embedded signup flow. + +![whatsapp_embedded_signup_start](/self-hosted/images/whatsapp/whatsapp_embedded_signup_start.png) + +### Step 4: Facebook Authentication + +You'll be redirected to Facebook to authenticate. You need to log in with an existing Facebook account. + +![whatsapp_facebook_authentication](/self-hosted/images/whatsapp/whatsapp_facebook_authentication.png) + +### Step 5: Fill Business Information + +Select an existing business portfolio or create a new one to add your phone number. Fill in the required business information: + +- Business portfolio +- Business name +- Business website or profile page +- Country +- Address (optional) + +![whatsapp_business_information](/self-hosted/images/whatsapp/whatsapp_business_information.png) + +### Step 6: Select WhatsApp Business Account + +Choose an existing WhatsApp Business account or create a new one. You can also select or create a WhatsApp Business Profile. + +![whatsapp_account_selection](/self-hosted/images/whatsapp/whatsapp_account_selection.png) + +### Step 7: Complete Setup + +Once you've completed all steps, you'll see the success screen. Your WhatsApp Business account is now connected and ready to receive messages. + +![whatsapp_setup_complete](/self-hosted/images/whatsapp/whatsapp_setup_complete.png) + +![whatsapp_app_config](/self-hosted/images/whatsapp/whatsapp_app_config.png) + +## Key Features + +- **No manual configuration required**: The entire webhook and phone number setup is automated +- **Secure OAuth based authentication**: Uses Meta's official OAuth 2.0 flow +- **Automatic webhook and phone number configuration**: Webhooks are registered automatically +- **Real-time progress tracking**: Visual feedback during the signup process +- **Comprehensive error handling**: Clear error messages and guidance + +## Commerce Policy Compliance + +Meta will review your business to ensure it complies with WhatsApp's Commerce Policy and will reach out within 24 hours if there's an issue. + +## Reference Documentation + +For more technical details about WhatsApp Embedded Signup, refer to the official Meta documentation: +- [WhatsApp Embedded Signup - Meta for Developers](https://developers.facebook.com/docs/whatsapp/embedded-signup/) + +## Troubleshooting + +### Common Issues + +1. **"WhatsApp Embedded Signup not available"** + - Ensure your Super Admin has configured the required environment variables + - Check that all three values (App ID, Configuration ID, and App Secret) are properly set + +2. **Authentication Errors** + - Make sure you're using an existing Facebook account + - Verify you have the necessary permissions for the business + +3. **Business Verification Issues** + - Ensure your business information is accurate and complete + - Check that your business complies with WhatsApp's Commerce Policy + +### Getting Help + +If you encounter issues during setup: + +1. Check the Chatwoot logs for any error messages +2. Verify all environment variables are correctly configured +3. Ensure your Facebook/WhatsApp accounts meet the prerequisites +4. Contact Chatwoot support with specific error messages if the issue persists diff --git a/self-hosted/images/whatsapp/whatsapp_account_selection.png b/self-hosted/images/whatsapp/whatsapp_account_selection.png new file mode 100644 index 00000000..9bf7cdab Binary files /dev/null and b/self-hosted/images/whatsapp/whatsapp_account_selection.png differ diff --git a/self-hosted/images/whatsapp/whatsapp_app_config.png b/self-hosted/images/whatsapp/whatsapp_app_config.png new file mode 100644 index 00000000..3ba8cd59 Binary files /dev/null and b/self-hosted/images/whatsapp/whatsapp_app_config.png differ diff --git a/self-hosted/images/whatsapp/whatsapp_business_information.png b/self-hosted/images/whatsapp/whatsapp_business_information.png new file mode 100644 index 00000000..65a35a48 Binary files /dev/null and b/self-hosted/images/whatsapp/whatsapp_business_information.png differ diff --git a/self-hosted/images/whatsapp/whatsapp_channel_selection.png b/self-hosted/images/whatsapp/whatsapp_channel_selection.png new file mode 100644 index 00000000..1708b17b Binary files /dev/null and b/self-hosted/images/whatsapp/whatsapp_channel_selection.png differ diff --git a/self-hosted/images/whatsapp/whatsapp_embedded_signup_start.png b/self-hosted/images/whatsapp/whatsapp_embedded_signup_start.png new file mode 100644 index 00000000..80f7b251 Binary files /dev/null and b/self-hosted/images/whatsapp/whatsapp_embedded_signup_start.png differ diff --git a/self-hosted/images/whatsapp/whatsapp_facebook_authentication.png b/self-hosted/images/whatsapp/whatsapp_facebook_authentication.png new file mode 100644 index 00000000..75bf2c6b Binary files /dev/null and b/self-hosted/images/whatsapp/whatsapp_facebook_authentication.png differ diff --git a/self-hosted/images/whatsapp/whatsapp_provider_selection.png b/self-hosted/images/whatsapp/whatsapp_provider_selection.png new file mode 100644 index 00000000..43791b28 Binary files /dev/null and b/self-hosted/images/whatsapp/whatsapp_provider_selection.png differ diff --git a/self-hosted/images/whatsapp/whatsapp_setup_complete.png b/self-hosted/images/whatsapp/whatsapp_setup_complete.png new file mode 100644 index 00000000..9fbd7d6b Binary files /dev/null and b/self-hosted/images/whatsapp/whatsapp_setup_complete.png differ