From db8ba38765c3fbcb987397c8d7a409cedca7c09d Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 16 Apr 2026 13:23:22 +0200 Subject: [PATCH 1/4] docs(react-native): Document screenshot masking options for Android Document the new `screenshot.maskAllText` and `screenshot.maskAllImages` options for error screenshot masking on Android. Companion SDK PR: https://github.com/getsentry/sentry-react-native/pull/6007 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../react-native/configuration/options.mdx | 17 +++++++++++++++++ .../attach-screenshots/react-native.mdx | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/docs/platforms/react-native/configuration/options.mdx b/docs/platforms/react-native/configuration/options.mdx index b084e3929ead4..b9e88058932c0 100644 --- a/docs/platforms/react-native/configuration/options.mdx +++ b/docs/platforms/react-native/configuration/options.mdx @@ -153,6 +153,23 @@ _(New in version 4.11.0)_ + + +Configures masking for error screenshots on Android. When `attachScreenshot` is enabled, these options control what gets masked in the captured screenshot. Both `maskAllText` and `maskAllImages` default to `true`. + +```javascript +screenshot: { + maskAllText: true, + maskAllImages: true, +} +``` + +Learn more in our Screenshots documentation. + +Currently only supported on Android. + + + Renders a JSON representation of the entire view hierarchy of the application when an error happens and includes it as an attachment. diff --git a/platform-includes/enriching-events/attach-screenshots/react-native.mdx b/platform-includes/enriching-events/attach-screenshots/react-native.mdx index fa89b768c6a38..641ae5dcd6b78 100644 --- a/platform-includes/enriching-events/attach-screenshots/react-native.mdx +++ b/platform-includes/enriching-events/attach-screenshots/react-native.mdx @@ -6,3 +6,22 @@ Sentry.init({ attachScreenshot: true, }); ``` + +### Screenshot Masking (Android) + +On Android, you can configure masking to automatically redact sensitive content like text and images from error screenshots. Masking is enabled by default. + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + attachScreenshot: true, + screenshot: { + maskAllText: true, // default: true + maskAllImages: true, // default: true + }, +}); +``` + + +Screenshot masking on Android requires the `sentry-android-replay` module at runtime. This is included automatically when using the Sentry React Native SDK. + From acff284d30cb7eb2e0f4537f1af6082eb7d20ac8 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 16 Apr 2026 13:43:52 +0200 Subject: [PATCH 2/4] fix: Replace Note with Alert component to fix build The Note component is not available in the platform-include rendering context. Use Alert instead, which is the established pattern. Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/platforms/react-native/configuration/options.mdx | 6 +++++- .../enriching-events/attach-screenshots/react-native.mdx | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/platforms/react-native/configuration/options.mdx b/docs/platforms/react-native/configuration/options.mdx index b9e88058932c0..5f24ba208dd9f 100644 --- a/docs/platforms/react-native/configuration/options.mdx +++ b/docs/platforms/react-native/configuration/options.mdx @@ -166,7 +166,11 @@ screenshot: { Learn more in our Screenshots documentation. -Currently only supported on Android. + + +Currently only supported on Android. + + diff --git a/platform-includes/enriching-events/attach-screenshots/react-native.mdx b/platform-includes/enriching-events/attach-screenshots/react-native.mdx index 641ae5dcd6b78..c1d34a6e606d8 100644 --- a/platform-includes/enriching-events/attach-screenshots/react-native.mdx +++ b/platform-includes/enriching-events/attach-screenshots/react-native.mdx @@ -22,6 +22,8 @@ Sentry.init({ }); ``` - + + Screenshot masking on Android requires the `sentry-android-replay` module at runtime. This is included automatically when using the Sentry React Native SDK. - + + From da73131854e516ecaf03dc026431f8b798c70653 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 16 Apr 2026 16:14:23 +0200 Subject: [PATCH 3/4] fix: Remove Android-only language, screenshot masking works on both platforms Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/platforms/react-native/configuration/options.mdx | 8 +------- .../attach-screenshots/react-native.mdx | 10 ++-------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/platforms/react-native/configuration/options.mdx b/docs/platforms/react-native/configuration/options.mdx index 5f24ba208dd9f..80070aac2614c 100644 --- a/docs/platforms/react-native/configuration/options.mdx +++ b/docs/platforms/react-native/configuration/options.mdx @@ -155,7 +155,7 @@ _(New in version 4.11.0)_ -Configures masking for error screenshots on Android. When `attachScreenshot` is enabled, these options control what gets masked in the captured screenshot. Both `maskAllText` and `maskAllImages` default to `true`. +Configures masking for error screenshots. When `attachScreenshot` is enabled, these options control what gets masked in the captured screenshot. Both `maskAllText` and `maskAllImages` default to `true`. ```javascript screenshot: { @@ -166,12 +166,6 @@ screenshot: { Learn more in our Screenshots documentation. - - -Currently only supported on Android. - - - diff --git a/platform-includes/enriching-events/attach-screenshots/react-native.mdx b/platform-includes/enriching-events/attach-screenshots/react-native.mdx index c1d34a6e606d8..b0105fb40c476 100644 --- a/platform-includes/enriching-events/attach-screenshots/react-native.mdx +++ b/platform-includes/enriching-events/attach-screenshots/react-native.mdx @@ -7,9 +7,9 @@ Sentry.init({ }); ``` -### Screenshot Masking (Android) +### Screenshot Masking -On Android, you can configure masking to automatically redact sensitive content like text and images from error screenshots. Masking is enabled by default. +You can configure masking to automatically redact sensitive content like text and images from error screenshots. Masking is enabled by default. ```javascript Sentry.init({ @@ -21,9 +21,3 @@ Sentry.init({ }, }); ``` - - - -Screenshot masking on Android requires the `sentry-android-replay` module at runtime. This is included automatically when using the Sentry React Native SDK. - - From 2983aeead5aa0f7d0365101bcdcfbbea6a9fb6d5 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 16 Apr 2026 16:41:45 +0200 Subject: [PATCH 4/4] docs: Add maskedViewClasses and unmaskedViewClasses documentation Co-Authored-By: Claude Opus 4.6 (1M context) --- .../react-native/configuration/options.mdx | 4 +++- .../attach-screenshots/react-native.mdx | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/platforms/react-native/configuration/options.mdx b/docs/platforms/react-native/configuration/options.mdx index 80070aac2614c..5ec66bf58fb3b 100644 --- a/docs/platforms/react-native/configuration/options.mdx +++ b/docs/platforms/react-native/configuration/options.mdx @@ -155,12 +155,14 @@ _(New in version 4.11.0)_ -Configures masking for error screenshots. When `attachScreenshot` is enabled, these options control what gets masked in the captured screenshot. Both `maskAllText` and `maskAllImages` default to `true`. +Configures masking for error screenshots. When `attachScreenshot` is enabled, these options control what gets masked in the captured screenshot. Both `maskAllText` and `maskAllImages` default to `true`. You can also specify native view classes to mask or unmask using `maskedViewClasses` and `unmaskedViewClasses`. ```javascript screenshot: { maskAllText: true, maskAllImages: true, + maskedViewClasses: ["MKMapView"], + unmaskedViewClasses: ["MyCustomSafeView"], } ``` diff --git a/platform-includes/enriching-events/attach-screenshots/react-native.mdx b/platform-includes/enriching-events/attach-screenshots/react-native.mdx index b0105fb40c476..a1925da93abbc 100644 --- a/platform-includes/enriching-events/attach-screenshots/react-native.mdx +++ b/platform-includes/enriching-events/attach-screenshots/react-native.mdx @@ -21,3 +21,16 @@ Sentry.init({ }, }); ``` + +You can also mask or unmask specific native view classes. This is useful for views from third-party native libraries (for example, map views or payment forms): + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + attachScreenshot: true, + screenshot: { + maskedViewClasses: ["MKMapView"], // iOS class name + unmaskedViewClasses: ["MyCustomSafeView"], + }, +}); +```