Skip to main content

Session Replay

Generates: Screenshot frame data

Captures periodic screenshots and uploads them in a periodic way.

Enabling Session Replay

Session replay is enabled and configured from the Pulse dashboard via Remote Config — not from initialize(). This lets you roll out replay gradually, and adjust capture settings without shipping an app update.

From the dashboard you can enable or disable session replay, and configure text & input privacy and image privacy strategies.

What You Configure in Code

The only thing you need to do in code is mark sensitive views that should always be masked or always be shown, regardless of the remote privacy setting.

Per-Class Masking

Mask or unmask all instances of a given UIView subclass. Set this in the sessionReplay config block if you need to initialize with defaults before remote config arrives:

config.sessionReplay { replay in
replay.configure { cfg in
cfg.maskViewClasses = ["MyCustomSensitiveView"]
cfg.unmaskViewClasses = ["MyPublicBannerView"]
}
}

Per-View Masking

UIKit:

// Always mask this view
sensitiveLabel.pulseReplayMask()

// Always show this view (overrides a global maskAll setting)
avatarImageView.pulseReplayUnmask()

SwiftUI:

Text("Card number: 4242 ...")
.pulseReplayMask()

Image("avatar")
.pulseReplayUnmask()

Or via accessibilityIdentifier:

view.accessibilityIdentifier = "pulse-mask"    // always masked
view.accessibilityIdentifier = "pulse-unmask" // always shown

Privacy Modes

These are the available text and image privacy settings, configurable from the dashboard:

Text and Input

ValueBehavior
.maskAllAll text — labels, inputs, hints — replaced with blocks (default)
.maskAllInputsOnly editable inputs masked; static labels shown
.maskSensitiveInputsOnly password, email, phone inputs masked

Images

ValueBehavior
.maskAllAll images replaced with a solid rectangle (default)
.maskNoneImages shown as-is

Session replay respects the SDK-level dataCollectionState. When .pending, no screenshots are captured. When consent transitions to .allowed, capture resumes automatically. See Data Collection Consent.

Resource Usage

ConcernDefault behavior
CPUScreenshots taken on a background thread — UI is not blocked
MemoryFrames batched in memory up to maxBatchSize, then flushed to disk
DiskPersisted to Caches directory; cleared after successful upload
NetworkCompressed JPEG/WebP frames — lower compressionQuality to reduce payload size