Facebook Messenger Integration
Overview
Nexus receives and sends Facebook Messenger messages via the Meta Graph API. Conversations from Messenger appear in the omnichannel inbox alongside WhatsApp, Instagram, and email.
Capabilities
- Receive inbound Messenger messages (text, media, attachments).
- Send outbound text and media messages.
- Monitor page post comments.
- Fetch Facebook user profiles for contact enrichment.
Required permissions / scopes
pages_messagingpages_manage_metadatapages_read_engagementpages_show_list
Edge Functions
| Function | Direction | Purpose |
|---|---|---|
facebook-webhook | Inbound | Receives Messenger messages and page events |
facebook-send-message | Outbound | Sends Messenger messages |
facebook-fetch-profile | Read | Fetches sender profile data |
exchange-facebook-token | Auth | Exchanges short-lived token for long-lived token |
fetch-comments | Read | Fetches post comments |
fetch-posts | Read | Fetches page posts |
Webhook setup
Facebook webhooks are configured via the Meta App Dashboard. Subscribe to the messages, messaging_postbacks, and feed topics for the connected Page.
Common troubleshooting
| Issue | Resolution |
|---|---|
| Webhook not firing | Verify subscription in Meta App Dashboard → Webhooks. Check that the Page token is valid. |
| Token expired | Re-authenticate via Settings → Integrations → Facebook to refresh the long-lived token. |
| Profile fetch fails | Check that pages_show_list permission is granted. |