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.
Milana gives you granular control over what is and is not captured in session recordings. There are three mechanisms:
- Block — the element is replaced with a blank placeholder in the recording. Its contents are never sent to Milana.
- Mask — the element’s text or input value is replaced with
* characters of the same length. The structure is visible but the content is not.
- Ignore — user interactions on the element (clicks, inputs) are not recorded, but the element’s content is still visible in the replay.
Passwords (input[type="password"]), phone numbers (input[type="tel"]), and email addresses (input[type="email"]) are masked by default. Review all other form fields in your application — particularly fields that collect government IDs, financial data, or any other sensitive personal information — and apply the appropriate privacy controls.
Default CSS classes
The easiest way to apply privacy controls is to add a CSS class to the element in your HTML or JSX. The SDK respects these classes out of the box, with no additional configuration required.
| Class | Effect |
|---|
milana-block | Element is blocked — replaced with a placeholder, contents not recorded |
milana-mask | Text content and input values are masked with * |
milana-ignore | User interactions on the element are not recorded |
Block an element
<!-- The entire card, including all child content, will not be recorded -->
<div class="billing-card milana-block">
<span>Card ending in 4242</span>
</div>
Mask text content
<!-- The user's full name is captured as asterisks -->
<p class="milana-mask">Jonathan Appleseed</p>
<!-- The value typed into this field is masked regardless of input type -->
<input type="text" class="milana-mask" placeholder="National ID number" />
Ignore interactions
<!-- Clicks and keystrokes on this element are not recorded -->
<textarea class="milana-ignore" placeholder="Private notes"></textarea>
Custom classes and selectors
If you cannot use the default class names, configure your own via the privacy option when initializing.
<MilanaProvider
productId="prd_..."
clientKey="key_..."
sessionInfo={{ environment: "production", version: "1.0.0" }}
options={{
privacy: {
blockClass: "my-private",
blockSelector: "[data-sensitive]",
ignoreClass: "no-record",
ignoreSelector: "[data-no-record]",
maskTextClass: "redact-text",
maskInputClass: "redact-input",
},
}}
>
<App />
</MilanaProvider>
Milana("init", "prd_...", "key_...",
{ environment: "production", version: "1.0.0" },
{
privacy: {
blockClass: "my-private",
blockSelector: "[data-sensitive]",
ignoreClass: "no-record",
ignoreSelector: "[data-no-record]",
maskTextClass: "redact-text",
maskInputClass: "redact-input",
},
}
);
Full example
<MilanaProvider
productId="prd_..."
clientKey="key_..."
sessionInfo={{ environment: "production", version: "1.0.0" }}
options={{
privacy: {
blockClass: "milana-block",
blockSelector: "#stripe-elements, [data-payment-form]",
maskTextClass: "milana-mask",
maskInputClass: "milana-mask",
maskInputTypes: {
password: true,
tel: true,
},
shouldTrackQueryParams: true,
queryTrackingParamsDenyList: [/^invite$/i, /^signup_token$/i],
},
}}
>
<App />
</MilanaProvider>
Milana("init", "prd_...", "key_...",
{ environment: "production", version: "1.0.0" },
{
privacy: {
blockClass: "milana-block",
blockSelector: "#stripe-elements, [data-payment-form]",
maskTextClass: "milana-mask",
maskInputClass: "milana-mask",
maskInputTypes: {
password: true,
tel: true,
},
shouldTrackQueryParams: true,
queryTrackingParamsDenyList: [/^invite$/i, /^signup_token$/i],
},
}
);
For the full list of privacy options and their defaults, see the Privacy Options Reference.
Iframes
Privacy controls configured in the parent page do not propagate into iframes. See the Iframe Recording guide for setup instructions and how to apply privacy controls inside iframes.
Data residency
For full control over where session data is stored, you can bring your own storage bucket. See the BYO Storage guide.