how do I ensure that text and images are visible in session replays?
Hi Bradley A., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đ
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
To ensure that both text and images are visible (i.e., unmasked and unblocked) in Mixpanel Session Replays, you need to adjust the default privacy settings in your SDK initialization.
For Web (JavaScript SDK):
By default, all text is masked and images/videos are blocked. To unmask text and unblock images/videos, set the following options during initialization:
```
mixpanel.init('YOUR_PROJECT_TOKEN', { record_sessions_percent: 1, // Adjust as needed record_mask_text_selector: '', // Unmask all text elements record_block_selector: '' // Unblock images and videos });
- `record_mask_text_selector: ''` ensures that no text elements are masked.
- `record_block_selector: ''` ensures that no images or videos are blocked.
This will make all text and images visible in your session replays. Be sure to review privacy implications before making these changes, as sensitive data may be exposed if not properly masked or blocked. For more details, see the documentation on [Session Replay privacy controls](https://docs.mixpanel.com/docs/session-replay/session-replay-privacy-controls) and [additional configuration options](https://docs.mixpanel.com/docs/session-replay/implement-session-replay/session-replay-web#additional-configuration-options).
**For Mobile (iOS/Android):**
By default, all text, images, and WebViews are masked. You can unmask these by configuring the `autoMaskedViews` option:
**iOS Example:**
// Unmask image, text, and WebViews by passing an empty set MPSessionReplayConfig(recordSessionsPercent: 100.0, autoMaskedViews: [])
LBKS**Android Example:**
// Unmask image, text, and WebViews by passing an empty set MPSessionReplayConfig( recordSessionsPercent = 100.0, autoMaskedViews = emptySet() )
- Setting `autoMaskedViews` to an empty set disables automatic masking, making text and images visible in replays.
**Note:** Input fields (e.g., password or form fields) are always masked and cannot be unmasked for privacy reasons on both web and mobile platforms.
Always ensure you comply with privacy regulations and only unmask elements that do not contain sensitive user data. For more, see the [Session Replay Privacy Controls](https://docs.mixpanel.com/docs/session-replay/session-replay-privacy-controls) and platform-specific configuration guides:
- [Web Additional Configuration Options](https://docs.mixpanel.com/docs/session-replay/implement-session-replay/session-replay-web#additional-configuration-options)
- [iOS Additional Configuration Options](https://docs.mixpanel.com/docs/session-replay/implement-session-replay/session-replay-ios#additional-configuration-options)
- [Android Additional Configuration Options](https://docs.mixpanel.com/docs/session-replay/implement-session-replay/session-replay-android#additional-configuration-options)
kapa.ai is still learning and improving, please let me know how I did by reacting below.
âšī¸Â Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
