Skip to content

Conversation

@philprime
Copy link
Member

@philprime philprime commented Nov 28, 2025

DESCRIBE YOUR PR

Adds documentation about configuring masking of screenshots. Based on the already existing session replay masking documentation. As the two options sets are different (options.sessionReplay.* vs options.screenshot.*) we should duplicate the documentation for now in case of drift.

We need to revisit this issue with getsentry/sentry-cocoa#6060

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • 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

@vercel
Copy link

vercel bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sentry-docs Ready Ready Preview Comment Dec 5, 2025 10:56am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
develop-docs Ignored Ignored Preview Dec 5, 2025 10:56am

Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM with a few suggestions.

Comment on lines +72 to +77
You can also choose to mask or unmask a specific view instance by using the replay API (`SentrySDK.replay`) or view extensions like this:

```swift
SentrySDK.replay.maskView(view: view)
SentrySDK.replay.unmaskView(view: label)
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: The docs already mention that you can use the SR APIs for this above, but maybe we should again mention it here. Also, we should clearly explain if you need to enable SR or not for these APIs to work.

Side note: We should really have extra APIs for screenshots at some point. I find that quite confusing. 🤦

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep this PR on hold and introduce an API in the SDK first

@codecov
Copy link

codecov bot commented Nov 28, 2025

Bundle Report

Changes will increase total bundle size by 107.29kB (0.3%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 24.91MB 107.3kB (0.43%) ⬆️
sentry-docs-client-array-push 10.22MB -6 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 5.5MB -0.0%
6529.js -3 bytes 4.92MB -0.0%
../instrumentation.js -3 bytes 4.82MB -0.0%
../app/[[...path]]/page.js.nft.json 35.77kB 1.1MB 3.37%
../app/platform-redirect/page.js.nft.json 35.77kB 1.1MB 3.37%
../app/sitemap.xml/route.js.nft.json 35.77kB 1.1MB 3.38%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 893.1kB -0.0%
static/chunks/9366-*.js -3 bytes 436.99kB -0.0%
server/middleware-*.js -6.46kB 1.0kB -86.59%
server/middleware-*.js 6.46kB 7.46kB 645.5% ⚠️
static/fS5R7jRwMcROvXpkrIs4Z/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/fS5R7jRwMcROvXpkrIs4Z/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/nqm6A74xPzr4rwqrvKq8e/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/nqm6A74xPzr4rwqrvKq8e/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

@philprime
Copy link
Member Author

BLOCKED BY getsentry/sentry-cocoa#6953

Copy link
Contributor

@coolguyzone coolguyzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for adding.

Comment on lines +55 to +65
### Mask by View Class

You can choose which type of view you want to mask or unmask by using the `maskedViewClasses` or `unmaskedViewClasses` options.

By default, Sentry already masks text and image elements from UIKit. Every child of a view that is redacted will also be redacted. The `unmaskedViewClasses` property has precedence over `maskedViewClasses`, meaning if a view class appears in both lists, it will be unmasked.

Let's say you have a custom view that you want to mask and a `UILabel` subclass (which normally would be masked) that you don't want to mask. You can set the options like this:

```swift
options.screenshot.maskedViewClasses = [MyCustomView.self]
options.screenshot.unmaskedViewClasses = [MyCustomLabel.self]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Documented options.screenshot.* may not exist in SDK, causing runtime errors.
Severity: MEDIUM | Confidence: Medium

🔍 Detailed Analysis

The documentation introduces options.screenshot.* configuration options, including maskAllText, maskAllImages, maskedViewClasses, unmaskedViewClasses, enableViewRendererV2, and enableFastViewRendering. These options are not corroborated elsewhere in the documentation repository, unlike their options.sessionReplay.* counterparts. If these options.screenshot.* properties do not exist in the Sentry Cocoa SDK, developers attempting to configure them will encounter runtime errors.

💡 Suggested Fix

Verify the existence and exact names of all options.screenshot.* configuration properties in the Sentry Cocoa SDK. Update the documentation to accurately reflect the SDK's implementation.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: docs/platforms/apple/common/enriching-events/screenshots/index.mdx#L50-L65

Potential issue: The documentation introduces `options.screenshot.*` configuration
options, including `maskAllText`, `maskAllImages`, `maskedViewClasses`,
`unmaskedViewClasses`, `enableViewRendererV2`, and `enableFastViewRendering`. These
options are not corroborated elsewhere in the documentation repository, unlike their
`options.sessionReplay.*` counterparts. If these `options.screenshot.*` properties do
not exist in the Sentry Cocoa SDK, developers attempting to configure them will
encounter runtime errors.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5756755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants