-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(apple): Replay Redact #11418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(apple): Replay Redact #11418
Changes from 6 commits
c11fcc7
b2c94ff
059f1ee
461ee72
dd5d568
f9b2d64
2c9e40b
f08690d
f0819df
48c12d2
aaed0e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| title: Using Custom Redact for Session Replay | ||
| sidebar_order: 5501 | ||
| notSupported: | ||
| description: "Learn how to redact parts of your app's data in Session Replay." | ||
brustolin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
|
|
||
| <Alert> | ||
|
|
||
brustolin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| If you custom redact your Session Replays, you may accidentally expose sensitive customer data. Be sure to double-check what you choose to expose. | ||
|
|
||
| </Alert> | ||
|
|
||
| By default, our Session Replay SDK masks all text content, images, and user input. This helps ensure that no sensitive data will be exposed. You can also manually choose which parts of your app's data to redact by using the different options listed below. | ||
|
|
||
|
|
||
| ## Redact by View Class | ||
|
|
||
| You can choose which type of view you want to redact or ignore by using the `redactViewClasses` or `ignoreViewClasses` options. | ||
|
||
|
|
||
| Let's say you have a custom view that you want to redact and a `UILabel` subclass (which normally would be redacted) that you want to ignore. You can set the options like this: | ||
|
|
||
| ```swift | ||
| options.experimental.sessionReplay.redactViewClasses = [MyCustomView.self] | ||
| options.experimental.sessionReplay.ignoreViewClasses = [MyCustomLabel.self] | ||
| ``` | ||
brustolin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Redact by View Instance | ||
|
|
||
| You can also choose to redact or ignore a specific view instance by using the [replay API](/api/replays/) or view extensions like this: | ||
brustolin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```swift | ||
| SentrySDK.replay.redactView(view: view) | ||
| SentrySDK.replay.ignoreView(view: label) | ||
| ``` | ||
| or | ||
|
|
||
| ```swift | ||
| view.sentryReplayRedact() | ||
| label.sentryReplayIgnore() | ||
| ``` | ||
|
|
||
| ## SwiftUI | ||
|
|
||
| Because of the way SwiftUI is transformed into UIKit, it will often be over-redacted. A modifier like `background` uses the same element as an `Image`. | ||
| In order to control the SwiftUI redact process, you first need to disable the default redaction options: | ||
|
|
||
| ```swift | ||
| options.experimental.sessionReplay.redactAllText = false | ||
| options.experimental.sessionReplay.redactAllImages = false | ||
| ``` | ||
|
|
||
| Then you can manually choose which `View` you want to redact with the `replayRedact` modifier: | ||
|
|
||
| ```swift | ||
| var body: some View { | ||
| Text("Hello, World!") | ||
| .sentryReplayRedact() | ||
brustolin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| ``` | ||
|
|
||
| <Note> | ||
| Disabling the default redaction options will expose all text and images in the session replay. | ||
| Make sure to redact them manually. | ||
| </Note> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we name it
Privacysimilar to the JS sdk? https://docs.sentry.io/platforms/javascript/session-replay/privacyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know, should we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also add here the
resume/pausefunctionality, and I think in this case it'd make sense to rename it as it's not only custom redaction/masking anymore. MaybePrivacy Controlsor something like that would do?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I will improve in another doc. This is waiting for too long