Skip to content

Commit 110023e

Browse files
antonisclaude
andauthored
docs(react-native): Document screenshot masking options (#17362)
## DESCRIBE YOUR PR Documents the new `screenshot` options for error screenshot masking on Android and iOS in the React Native SDK. **New options documented:** - `screenshot.maskAllText` / `screenshot.maskAllImages` — toggle automatic masking of text and images - `screenshot.maskedViewClasses` / `screenshot.unmaskedViewClasses` — mask or unmask specific native view classes **Changes:** - Updated the screenshots platform include (`react-native.mdx`) with a "Screenshot Masking" section showing configuration examples - Added the `screenshot` option to the React Native configuration options reference page Companion SDK PR: getsentry/sentry-react-native#6007 Resolves: getsentry/sentry-react-native#5763 ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.) - [ ] Other deadline - [x] None: Not urgent, can wait up to 1 week+ ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 849e899 commit 110023e

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

docs/platforms/react-native/configuration/options.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,23 @@ _(New in version 4.11.0)_
153153

154154
</SdkOption>
155155

156+
<SdkOption name="screenshot" type="object">
157+
158+
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`.
159+
160+
```javascript
161+
screenshot: {
162+
maskAllText: true,
163+
maskAllImages: true,
164+
maskedViewClasses: ["MKMapView"],
165+
unmaskedViewClasses: ["MyCustomSafeView"],
166+
}
167+
```
168+
169+
Learn more in our <PlatformLink to="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>.
170+
171+
</SdkOption>
172+
156173
<SdkOption name="attachViewHierarchy" type="boolean" defaultValue="false">
157174

158175
Renders a JSON representation of the entire view hierarchy of the application when an error happens and includes it as an attachment.

platform-includes/enriching-events/attach-screenshots/react-native.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,31 @@ Sentry.init({
66
attachScreenshot: true,
77
});
88
```
9+
10+
### Screenshot Masking
11+
12+
You can configure masking to automatically redact sensitive content like text and images from error screenshots. Masking is enabled by default.
13+
14+
```javascript
15+
Sentry.init({
16+
dsn: "___PUBLIC_DSN___",
17+
attachScreenshot: true,
18+
screenshot: {
19+
maskAllText: true, // default: true
20+
maskAllImages: true, // default: true
21+
},
22+
});
23+
```
24+
25+
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):
26+
27+
```javascript
28+
Sentry.init({
29+
dsn: "___PUBLIC_DSN___",
30+
attachScreenshot: true,
31+
screenshot: {
32+
maskedViewClasses: ["MKMapView"], // iOS class name
33+
unmaskedViewClasses: ["MyCustomSafeView"],
34+
},
35+
});
36+
```

0 commit comments

Comments
 (0)