---
title: "Privacy"
description: "Learn about the privacy-oriented settings for Session Replay."
url: https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy/
last_updated: 2026-12-02T17:51:14.000Z
---

# Privacy for Flutter

Session Replay masking is best effort. The SDK automatically masks only the components listed in [**Supported Components**](https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy.md#supported-components) for your SDK. It may not mask content from third-party libraries, components that draw their own content, or new versions of UI frameworks and libraries that change how they render, even with the default settings.

We monitor new versions of popular UI frameworks and libraries, such as Jetpack Compose and SwiftUI, and fix masking regressions on a best-effort basis.

Before you enable Session Replay in production, test your app with the exact UI frameworks, libraries, and versions it ships with, and mask anything that isn't covered by using the masking options for your SDK. If a supported component isn't masked, don't deploy Session Replay to production until it's fixed.

The SDK masks the widgets listed in [Supported Components](https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy.md#supported-components). Report masking issues with supported widgets in [getsentry/sentry-dart](https://github.com/getsentry/sentry-dart/issues/new/choose).

Masking in the Sentry Flutter SDK is based on Widget *types*, e.g. `Image`, not the string representation of the type (i.e. we check whether a `widgetInstance` should be masked by checking `if (widgetInstance is Image)` instead of `if (widgetInstance.runtimeType == 'Image')`). This means we can ensure masking works regardless of obfuscation in release builds and also works for subclasses. This approach allows the SDK to automatically mask widgets that are part of the Flutter SDK itself. However, for third-party widgets, you need to manually configure the privacy settings to mask their content. Read more about [Third Party Widgets](https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy.md#third-party-widgets) below.

## [Privacy Configuration](https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy.md#privacy-configuration)

The following options can be configured in the `options.privacy` field of your Sentry Flutter SDK, in `SentryFlutter.init((options) { ... })`:

| Key                               | Type   | Default | Description                                                                                                                                                                                                                              |
| --------------------------------- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| maskAllText                       | `bool` | `true`  | Mask all text content. Draws a rectangle of text bounds with text color on top. Currently `Text`, `EditableText` and `RichText` widgets are masked.                                                                                      |
| maskAllImages                     | `bool` | `true`  | Mask content of all images. Draws a rectangle of image bounds with image's dominant color on top. Currently `Image` widgets are masked.                                                                                                  |
| maskAssetImages                   | `bool` | `false` | Mask asset images coming from the root asset bundle.                                                                                                                                                                                     |
| mask\<T extends Widget>()         | `void` | /       | Mask given widget type `T` (or subclasses of `T`). Note: masking rules are called in the order they're added so if a previous rule already makes a decision, this rule won't be called.                                                  |
| unmask\<T extends Widget>()       | `void` | /       | Unmask given widget type `T` (or subclasses of `T`). Note: masking rules are called in the order they're added so if a previous rule already makes a decision, this rule won't be called.                                                |
| maskCallback\<T extends Widget>() | `void` | /       | Provide a custom callback to decide whether to mask the widget of class `T` (or subclasses of `T`). Note: masking rules are called in the order they're added so if a previous rule already makes a decision, this rule won't be called. |

For example, you can explicitly mask or unmask widgets by type, or you can even have a callback to decide whether a specific widget instance should be masked:

```dart
options.privacy.mask<IconButton>();
options.privacy.unmask<Image>();
options.privacy.maskCallback<Text>(
    (Element element, Text widget) =>
        (widget.data?.contains('secret') ?? false)
            ? SentryMaskingDecision.mask
            : SentryMaskingDecision.continueProcessing);
```

If you find that data isn't being masked with the default settings, please let us know by creating a [GitHub issue](https://github.com/getsentry/sentry-dart/issues/new?template=BUG_REPORT.yml).

To disable the default text and image masking rules for screenshots and Session Replay, use the following options. This does not disable `SensitiveContent` masking, `SentryMask`, or custom rules. Only use these settings when the content is safe to capture:

```dart
options.privacy.maskAllText = false;
options.privacy.maskAllImages = false;
```

## [SensitiveContent Widgets](https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy.md#sensitivecontent-widgets)

The default rules mask Flutter `SensitiveContent` widgets marked `ContentSensitivity.sensitive` or `ContentSensitivity.autoSensitive`. Unrecognized sensitivity values are also masked. `ContentSensitivity.notSensitive` continues through other masking rules; it does not unmask the content by itself.

These rules apply to both screenshots and Session Replay. Custom rules and `SentryUnmask` take precedence over the default rules, so verify your configuration if you override masking.

## [Supported Components](https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy.md#supported-components)

With the default settings, the SDK masks these Flutter SDK widgets and their subclasses:

| Widget                                                   | Masked when                                                                                                                                                     |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Text`, `EditableText`, `RichText`                       | `maskAllText` is `true` (default)                                                                                                                               |
| `Image`                                                  | `maskAllImages` is `true` (default). Asset images (`AssetImage`, `ExactAssetImage`) from the root asset bundle aren't masked unless `maskAssetImages` is `true` |
| `SensitiveContent` marked `sensitive` or `autoSensitive` | By default, even when `maskAllText` and `maskAllImages` are `false`                                                                                             |

These are the default masking rules. A custom widget can contain supported children, but don't assume the rest of the widget is masked. This includes widgets from third-party packages and widgets that draw their own content with `CustomPaint`, such as maps and charts. Mask them with `options.privacy.mask<T>()` or the `SentryMask` widget. See [Third Party Widgets](https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy.md#third-party-widgets).

## [Third Party Widgets](https://docs.sentry.io/platforms/dart/guides/flutter/session-replay/privacy.md#third-party-widgets)

The Sentry Flutter SDK cannot automatically mask widgets from third party packages. You need to manually configure the privacy configuration to mask the content of these widgets.

For example, if you are using the [FlutterMap](https://pub.dev/packages/flutter_map) package, you need to add the following privacy configuration:

```dart
options.privacy.mask<FlutterMap>();
```

---

Find other pages: [Sitemap](https://docs.sentry.io/sitemap.md) lists every page with a one-line summary, and [llms.txt](https://docs.sentry.io/llms.txt) gives an overview with guidance for agents.
