Documentation Index
Fetch the complete documentation index at: https://docs.getmilana.ai/llms.txt
Use this file to discover all available pages before exploring further.
Same-origin iframes
Milana automatically records content inside same-origin iframes. No additional configuration is needed — if the iframe shares the same origin as the parent page, its DOM is captured as part of the session.Cross-origin iframes
Cross-origin iframes (iframes hosted on a different domain) are not recorded by default. To capture their content, you need to configure both the parent page and the iframe.Step 1: Enable in the parent page
SetshouldRecordCrossOriginIframes: true in your init options.
- React
- JavaScript
- Script Tag
Step 2: Initialize inside the iframe
In the iframe’s own page, load the Milana SDK and callinitCrossOriginIframe(). This starts a lightweight recorder inside the iframe that forwards DOM events to the parent page’s session.
- JavaScript
- Script Tag
You do not need to pass a product ID or client key inside the iframe — the iframe recording is linked to the parent page’s session automatically via
postMessage.Privacy controls inside iframes
Use the same CSS classes inside the iframe’s markup:password, tel, email) still applies automatically inside iframes.
Content Security Policy
The parent page needs everything documented in your install quickstart. The iframe page does not needconnect-src for in.getmilana.ai — initCrossOriginIframe() forwards events to the parent via postMessage, and the parent recorder is what reaches ingest.
The iframe page does need:
script-src https://cdn.getmilana.ai— only if you load the SDK via script tag inside the iframe (also needs'unsafe-inline'or a nonce for the queue snippet).frame-ancestorspermitting your parent origin. This is independent of Milana, but a strict iframe-side CSP can break thepostMessageintegration the SDK relies on.
Common use cases
- Embedded payment forms (Stripe, Braintree) — enable cross-origin recording to see the flow, but ensure sensitive fields are blocked
- Third-party widgets (chat, calendars, embedded editors) hosted on a different domain
- Micro-frontends served from separate origins