atatus_session_replay, and runs on top of RUM.
Session Replay for Flutter is in preview, and parts of its public API may change without a major version update.
Prerequisites
- RUM is set up in your application. See Flutter Monitoring Setup.
- Flutter 3.27.0 or higher and Dart SDK 3.6.0 or higher.
- Android 6.0 (API level 23) or higher, or iOS 15.0 or higher.
Setup
1. Add the package
Addatatus_session_replay alongside the plugin in your pubspec.yaml:
2. Enable Session Replay
CallenableSessionReplay on your AtatusConfiguration. RUM must be configured for replay to record anything:
3. Add the capture widget
Add aSessionReplayCapture widget at the root of your widget tree, above MaterialApp or your equivalent application widget. A Key is required:
Configuration Options
AtatusSessionReplayConfiguration accepts the following options:
The replay sample rate applies to sessions that
sessionSamplingRate already kept, so the two multiply. With the default session rate of 100, a replay sample rate of 30 records a replay for 30% of all sessions. At a session rate of 80, the same replay rate records 24%.Privacy
Session Replay masks everything by default. Loosen the defaults only for the parts of your application you are sure carry no personal data.Default privacy levels
TextAndInputPrivacyLevel controls text and input widgets:
ImagePrivacyLevel controls images:
TouchPrivacyLevel controls touch indicators:
Override privacy for part of the tree
Wrap a subtree inSessionReplayPrivacy to change the privacy level for that part of the application, or to hide it entirely:
null leaves that level unchanged for the subtree.
Validate That Replay Data Is Being Sent
To confirm the SDK is recording and uploading replays, raise its verbosity before you initialize it:CoreLoggerLevel.warn, and internal logging only runs in debug builds. Session Replay upload messages from the underlying Android SDK then appear in the device log.
Tracking Consent
Session Replay follows the same tracking consent value as the rest of the SDK, which you set at initialization and can update at any time. See Set Tracking Consent (GDPR).Current Limitations
- Recording cannot be started or stopped at runtime. Recording begins when Session Replay is enabled and continues for the session. Use
replaySampleRateto control which sessions are recorded, or callenableSessionReplayconditionally to decide at startup. - Web view content is not captured in the replay. The recorder walks the Flutter widget tree, so anything a web view renders appears as an opaque region. RUM events from web views are still collected (use the
atatus_webview_trackingpackage for that), but they do not produce replay footage.
Next steps
- Configure the rest of the agent in Flutter Agent Configuration Options.
- Correlate replays with your logs using Flutter Log Collection.