> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/channels/all-channels/facebook/facebook-webview-whitelisting.md). Agents can also search and read this documentation through its [MCP server](https://docs.chatlayer.ai/~gitbook/mcp).

# Facebook Webview Whitelisting

Facebook allows webviews to be shown within the conversation between a bot and its user. These webviews are typically made of small applications that contain logic that is not possible to show within the default Facebook templates – like buttons and carousels.

{% hint style="success" %}
If you add a webview to a Facebook Messenger bot, the domain that hosts this webview has to be whitelisted. But only the domains that you enter as a webview on our platform have to be whitelisted.

Follow Facebook's instructions for whitelisting a domain [here](https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api/domain-whitelisting/#page_settings).
{% endhint %}

You can add a webview by adding a button template, and adding a new button with the type `Webview`.

![](https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-L_gGKc4h1wJFCLcVDG_%2F-L_gHWaTUKWMs4HklZua%2Fimage.png?alt=media\&token=ffad3a04-fb19-445b-8102-f473f7bc3d96)

Fill in this template with the right copy and URL and optional parameters that are passed on to the webview.

![](https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLTwFwbOqJj4dDhg8Ju%2F-L_gGKc4h1wJFCLcVDG_%2F-L_gH7yrYjeHgIIYJgak%2Fimage.png?alt=media\&token=6003cbc3-f373-45a7-b545-386782cbb431)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chatlayer.ai/channels/all-channels/facebook/facebook-webview-whitelisting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
