> ## Documentation Index
> Fetch the complete documentation index at: https://docs.profclaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Facebook Messenger

> Connect profClaw to Facebook Messenger via the Meta Messenger Platform. Requires a Facebook Page.

profClaw integrates with Facebook Messenger through the Meta Messenger Platform. The bot is attached to a Facebook Page and responds to messages sent to that page.

## Capabilities

| Feature | Supported |
| - | - |
| 1:1 messaging | Yes |
| Quick replies | Yes |
| Persistent menu | Yes |
| Generic templates | Yes |
| Media messages | Yes |
| Webhook | Yes |
| Page subscription | Yes |

## Setup

**1. Create a Facebook App**

Go to [developers.facebook.com](https://developers.facebook.com) and create a new app. Choose **Business** type.

**2. Add Messenger Product**

Under your app, add the **Messenger** product.

**3. Link to a Facebook Page**

Under **Messenger > Settings**, generate a **Page Access Token** for your Facebook Page.

**4. Configure webhook**

Set webhook URL to: `https://your-domain.com/webhooks/messenger`

Set a verify token (any string you choose) and subscribe to `messages` and `messaging_postbacks`.

**5. Configure profClaw**

```bash theme={null}
MESSENGER_PAGE_ACCESS_TOKEN=EAABwzLixnjYBO...
MESSENGER_VERIFY_TOKEN=my-verify-token
MESSENGER_APP_SECRET=your-app-secret
```

## Environment Variables

**MESSENGER\_PAGE\_ACCESS\_TOKEN** `string` *required*

Facebook Page access token (from Meta Developer portal).

**MESSENGER\_VERIFY\_TOKEN** `string` *required*

Your custom verify token for webhook setup.

**MESSENGER\_APP\_SECRET** `string` *required*

App secret for request signature verification.

## Configuration Example

> [tab] .env
>
> ```bash theme={null}
> MESSENGER_PAGE_ACCESS_TOKEN=EAABwzLixnjYBO...
> MESSENGER_VERIFY_TOKEN=my-verify-token
> MESSENGER_APP_SECRET=abc123def456
> ```

> [tab] settings.yml
>
> ```yaml theme={null}
> chat:
>   messenger:
>     page_access_token: "${MESSENGER_PAGE_ACCESS_TOKEN}"
>     verify_token: "${MESSENGER_VERIFY_TOKEN}"
>     app_secret: "${MESSENGER_APP_SECRET}"
> ```

## Message Templates

profClaw can send rich templates:

```json theme={null}
{
  "recipient": { "id": "user-psid" },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "button",
        "text": "What would you like to do?",
        "buttons": [
          { "type": "postback", "title": "Get Status", "payload": "STATUS" }
        ]
      }
    }
  }
}
```

## Notes

* Status: Beta
* Requires a public HTTPS webhook URL.
* Messenger Platform requires App Review for production use with more than 5 testers.
* After App Review, the bot can message any Facebook user who messages the page.
* GDPR compliance: Users can opt-out via the standard Messenger controls.

## Related

* [Chat Providers Overview](https://docs.profclaw.ai/chat-providers/overview.md) - Compare all 27 supported channels
* [WhatsApp](https://docs.profclaw.ai/chat-providers/whatsapp.md) - Meta's other messaging platform for business
* [Viber](https://docs.profclaw.ai/chat-providers/viber.md) - Similar audience in Eastern Europe and Southeast Asia
* [profclaw channels](https://docs.profclaw.ai/cli/channels.md) - Enable and test the Messenger connection from the CLI


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.