> For the complete documentation index, see [llms.txt](https://firstoken.gitbook.io/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://firstoken.gitbook.io/api-docs/guides/implementing-hosted-iframes/iframe-communication.md).

# Iframe Communication

Firstoken Captures communicates use the native Window\.postMessage() method to communicate with your web page. At the end of each capture Firstoken Capture sends a message with the data returned from the transaction. This process of capturing the data from your own page is ideal for closing the loop once the transaction is complete.

This is an example of client-side usage showing how to receive a message from the iframe:

```javascript
window.addEventListener("message", (event) => {
    if (event.origin == "https://captures.firstoken.co")
    // do something;
}, false);
```
