Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/platforms/react-native/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,23 @@ _(New in version 4.11.0)_

</SdkOption>

<SdkOption name="screenshot" type="object">

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"],
}
```

Learn more in our <PlatformLink to="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>.

</SdkOption>

<SdkOption name="attachViewHierarchy" type="boolean" defaultValue="false">

Renders a JSON representation of the entire view hierarchy of the application when an error happens and includes it as an attachment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,31 @@ Sentry.init({
attachScreenshot: true,
});
```

### Screenshot Masking

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
},
});
```

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"],
},
});
```
Loading