Facebook Setup
Overview
The Facebook channel connects Anyy to Facebook Messenger for a Page. It supports direct messages, webhook receiving, inbound media, typing indicators, and live-smoke checks.
The adapter does not advertise group support.
Prerequisites
- A Facebook Page.
- Page id.
- Page access token.
- Public HTTPS webhook endpoint for Anyy.
- Optional webhook verify token.
- Optional app secret for webhook signature verification.
Setup
Create credentials
Configure your Facebook app and Page subscription so Messenger events are sent to Anyy. The webhook path is owned by the channel adapter at runtime.
Configure Anyy
anyy setup channels facebook \
--set page_id=page-id \
--secret page_access_token='page-access-token' \
--write-config
With webhook verification material:
anyy setup channels facebook \
--set page_id=page-id \
--secret page_access_token='page-access-token' \
--secret webhook_verify_token='verify-token' \
--secret app_secret='facebook-app-secret' \
--write-config
Setup defaults:
| Field | Default |
|---|---|
account_id | page |
messaging_type | RESPONSE |
dm_policy | pairing |
send_chunk_chars | 1900 |
media_max_bytes | 5242880 |
Start Gateway
anyy gateway start
anyy channels reload
Run doctor checks
anyy channels doctor facebook
Access Policy
Direct messages
Facebook defaults to dm_policy: pairing. Use allowlist with sender ids when
the Page receives traffic from more than one person.
Groups
Facebook Messenger group support is not advertised by this adapter.
Admins
Facebook Page access policy and shared command authorization are separate.
Sessions
Each accepted Messenger sender maps to an Anyy session.
Media Support
Inbound media
Facebook advertises inbound media support. Files are limited by
media_max_bytes.
Outbound media
The adapter sends text replies and typing indicators. It does not advertise native outbound media.
Commands
Use shared messaging commands in Messenger.
Cron Delivery
anyy cron create \
--name "Messenger reminder" \
--schedule "30m" \
--prompt "Send the reminder" \
--delivery-target current_user_default \
--delivery-channel facebook
Troubleshooting
- Webhook verification fails: check
webhook_verify_token_ref. - Replies fail: confirm the Page access token and Page id.
- Unexpected sender: use
dm_policy: allowlist. - Media missing: check platform permissions and
media_max_bytes.