Handle Sensitive Data

To protect user privacy during session recordings, configure Session Replay to mask sensitive data by enabling options that obscure all text and input fields by default.

Rendering Modes

You can choose any of the following rendering modes to create session recordings. By default, Session Replay uses the Native mode.
Mode Description
NATIVE Regularly captures the app screen which the Session Replay immediately processes to remove sensitive data. The frames are then complied to make the session recording.
WIREFRAME Captures the app using only a wireframe representation of the screen data. No user data is recorded. This is the preferred rendering method for user data security.

Set the Rendering Mode

Configure the agent with the following code to set the rendering mode to NATIVE:

Objective-C
PYTHON
#import <ADEumInstrumentation/ADEumInstrumentation.h>
#import "AppDelegate.h"
 
    // ...
    -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        ADEumAgentConfiguration *config = [[ADEumAgentConfiguration alloc] initWithAppKey:<#EUM_APP_KEY#>];
        //The default SaaS EUM Server and Screenshot Service are in the Americas, 
		// so you can omit the following settings if you are in the Americas.
        config.collectorURL = @"https://<your_region>-col.eum-appdynamics.com";
        config.screenshotURL = @"https://<you_region>-image.eum-appdynamics.com/";
		config.renderingMode = ADEumNative;
        [ADEumInstrumentation initWithConfiguration: config];
		// other tasks
        return YES;
     }
Swift
JAVASCRIPT
#import <ADEumInstrumentation/ADEumInstrumentation.h>
#import "AppDelegate.h"
 
    // ...
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let config = ADEumAgentConfiguration(appKey: <#EUM_APP_KEY#>)
        config.collectorURL = "https://<your_region>.eum-appdynamics.com"
        config.screenshotURL = "https://<your_region>-image.eum-appdynamics.com"
		config.renderingMode = .native
        ADEumInstrumentation.initWith(config)
        // other tasks
        return true
    }
// ...

Configure the agent with the following code to set the rendering mode to WIREFRAME:

Objective-C
PYTHON
#import <ADEumInstrumentation/ADEumInstrumentation.h>
#import "AppDelegate.h"
 
    // ...
    -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        ADEumAgentConfiguration *config = [[ADEumAgentConfiguration alloc] initWithAppKey:<#EUM_APP_KEY#>];
        //The default SaaS EUM Server and Screenshot Service are in the Americas, 
		// so you can omit the following settings if you are in the Americas.
        config.collectorURL = @"https://<your_region>-col.eum-appdynamics.com";
        config.screenshotURL = @"https://<you_region>-image.eum-appdynamics.com/";
		config.renderingMode = ADEumWireframe;
        [ADEumInstrumentation initWithConfiguration: config];
		// other tasks
        return YES;
     }
Swift
JAVASCRIPT
#import <ADEumInstrumentation/ADEumInstrumentation.h>
#import "AppDelegate.h"
 
    // ...
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let config = ADEumAgentConfiguration(appKey: <#EUM_APP_KEY#>)
        config.collectorURL = "https://<your_region>.eum-appdynamics.com"
        config.screenshotURL = "https://<your_region>-image.eum-appdynamics.com"
		config.renderingMode = .wireframe
        ADEumInstrumentation.initWith(config)
        // other tasks
        return true
    }
// ...

Sensitivity

You can set sensitivity on elements in your project. Based on how you built your app, choose one of the following:

View Sensitivity

Set sensitivity to any View instance by using the following code:

Objective-C
CODE
[ADEumInstrumentation setViewInstanceSensitivityWithView:anyView isSensitive: @YES];
Swift
JAVASCRIPT
let isSensitive = NSNumber(value: true)
ADEumInstrumentation.setViewInstanceSensitivityWith(anyView, isSensitive: isSensitive)

Read sensitivity to any View instance using the following code:

Objective-C
CODE
NSNumber *isSensitive = [ADEumInstrumentation viewInstanceSensitivityWithView:anyView];
Swift
JAVASCRIPT
let isSensitive = ADEumInstrumentation.viewInstanceSensitivity(with: anyView)

Class Sensitivity

Set the sensitivity to all instances of a Class that extends a View rather than setting the sensitivity on a specific View:

Objective-C
CODE
[ADEumInstrumentation setViewClassSensitivityWithViewClass:[ViewSubclass class] isSensitive: @YES];
Swift
CODE
ADEumInstrumentation.setViewClassSensitivityWithViewClass(UIButton.self, isSensitive: isSensitive)

Read the sensitivity to all instances of a Class that extends a View rather than setting the sensitivity on a specific View:

Objective-C
CODE
NSNumber *buttonSensitivity = [ADEumInstrumentation viewClassSensitivityWithViewClass:[anyView class]];
Swift
JAVASCRIPT
let buttonSensitivity = ADEumInstrumentation.viewClassSensitivity(withViewClass: UIButton.self)

Recording Masks

Recording Masks Example

In cases where areas of the app shouldn't be recorded, but cannot be defined by a view, you can use RecordingMask:

Session Replay masks either by covering or erasing the sensitive data. Use the following configuration to set the recording masks:

Objective-C
CODE
ADEumMaskElement *maskElement = [[ADEumMaskElement alloc] initWithRect:coveringRect maskType:ADEumMaskTypeCovering];
ADEumMaskElement *maskElement1 = [[ADEumMaskElement alloc] initWithRect:erasingUpdateButtonRect maskType:ADEumMaskTypeErasing];
[ADEumInstrumentation sensitivityCoveringRectElements:@[maskElement, maskElement1]];
Swift
JAVASCRIPT
let maskElement = ADEumMaskElement(rect:coveringRect, maskType: .covering)
    let maskElement1 = ADEumMaskElement(rect:erasingUpdateButtonRect, maskType: .erasing)

    ADEumInstrumentation.sensitivityCoveringRectElements([maskElement, maskElement1])

You can only have one Recording mask set at a time, but the recording mask can contain a list of MaskType to cover multiple areas at once. Use the following mask types to protect sensitive data:

Mask Type How it Works?
MaskType.MASK_TYPE_COVERING The area defined by the element Rect is not recorded
MaskType.MASK_TYPE_ERASING The area defined by the element Rect is recorded even if a previous MaskType. inside a list was covering the area.