Issue
I configured maskAttributes for Session Replay, but attribute values such as aria-label still appear unmasked in my replays.
Applies To
All SaaS Customers and Self-Hosted Users
JavaScript SDK
Session Replay
Resolution
maskAttributes masks the listed HTML attribute names during Session Replay recording. The default list is title, placeholder, and aria-label. Listed attributes are masked even when maskAllText is false.
If an attribute still appears in the replay:
Confirm the attribute name is in
maskAttributes. Add it if it is missing from the default list.Confirm the element is not matched by an
unmaskselector (orsentry-unmask/data-sentry-unmask). Unmask takes precedence.Record a new replay after the config change. Older replays keep the privacy settings from when they were recorded.
Example:
Sentry.replayIntegration({
maskAttributes: ["title", "placeholder", "aria-label", "data-user-email"],
});
maskAllText still controls text-node masking and can also mask value on submit/button inputs when value is not listed in maskAttributes. It is not required for named attributes in maskAttributes.
For the full privacy option set, see Session Replay Privacy.
