Early Access
User interactions capture the names of UI elements, such as button labels or input field names. When these names contain or expose personal information, you can mask individual views so their UI element names are replaced with *** in captured interactions.
It's your responsibility to identify which views and components in your application may expose personal data and apply masking accordingly.
Set the tag data-dt-mask on the view.
myView.tag = "data-dt-mask"
The interaction will have the view name replaced with ***.
Apply the dtMask() modifier to the composable.
Button(onClick = { /* ... */ },modifier = Modifier.dtMask()) {Text("Pay now")}
The interaction will have the composable name replaced with ***.
Set the view's accessibilityIdentifier to data-dt-mask.
myView.accessibilityIdentifier = "data-dt-mask"
The interaction will have the view name replaced with ***.
Use the .dynatraceMasked() modifier or set the accessibilityIdentifier to data-dt-mask.
Button("Pay now") {// ...}.dynatraceMasked()
The interaction will have the view name replaced with ***.
React Native supports two masking approaches: marker-based masking using the dtMask prop, and rule-based masking via configuration.
To mask a component and all its children, add the dtMask prop to any ancestor view.
<View dtMask><Pressable onPress={onPress}><Text>john.doe@example.com</Text></Pressable></View>
Any interaction resolved through a subtree with dtMask on an ancestor is masked. The interaction is still captured, but the UI element name is replaced with ***.
To mask interactions based on testID patterns or text content length, configure masking rules in your Dynatrace configuration.
const config = {mask: {replaceWith: '***',testID: (id: string) => /email|phone/i.test(id),text: (text: string) => text.length > 20,},};
With this configuration:
testID matches the provided function are masked.Both approaches replace the sensitive label with the value of replaceWith (default: ***) while preserving the interaction identity and element path.
Wrap the widget with UserInteractionWidget and set masked to true.
UserInteractionWidget(masked: true,child: TextField(decoration: InputDecoration(labelText: 'Password'),),)
The interaction will have the widget name replaced with ***.