Skip to content

Commit f08690d

Browse files
committed
update
1 parent 2c9e40b commit f08690d

File tree

2 files changed

+46
-30
lines changed

2 files changed

+46
-30
lines changed
Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,82 @@
11
---
2-
title: Using Custom Redact for Session Replay
2+
title: Using Custom Masking for Session Replay
33
sidebar_order: 5501
44
notSupported:
5-
description: "Learn how to redact parts of your app's data in Session Replay."
5+
description: "Learn how to mask parts of your app's data in Session Replay."
66
---
77

88
<Alert>
99

10-
If you custom redact your Session Replays, you may accidentally expose sensitive customer data. Be sure to double-check what you choose to expose.
10+
If you choose to use custom masking in your Session Replays, you may accidentally expose sensitive customer data. Be sure to double-check what you choose to expose.
1111

1212
</Alert>
1313

14-
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.
14+
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 you want to mask by using the different options listed below.
1515

1616

17-
## Redact by View Class
17+
## Mask by View Class
1818

19-
You can choose which type of view you want to redact or ignore by using the `redactViewClasses` or `ignoreViewClasses` options.
19+
You can choose which type of view you want to mask or ignore by using the `maskedViewClasses` or `unmaskedViewClasses` options.
2020

21-
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:
21+
Let's say you have a custom view that you want to mask and a `UILabel` subclass (which normally would be masked) that you doesn't want to mask. You can set the options like this:
2222

2323
```swift
24-
options.experimental.sessionReplay.redactViewClasses = [MyCustomView.self]
25-
options.experimental.sessionReplay.ignoreViewClasses = [MyCustomLabel.self]
24+
options.experimental.sessionReplay.maskedViewClasses = [MyCustomView.self]
25+
options.experimental.sessionReplay.unmaskedViewClasses = [MyCustomLabel.self]
2626
```
2727

28-
## Redact by View Instance
28+
## Mask by View Instance
2929

30-
You can also choose to redact or ignore a specific view instance by using the [replay API](/api/replays/) or view extensions like this:
30+
You can also choose to mask or unmask a specific view instance by using the [replay API](/api/replays/) or view extensions like this:
3131

3232
```swift
33-
SentrySDK.replay.redactView(view: view)
34-
SentrySDK.replay.ignoreView(view: label)
33+
SentrySDK.replay.maskView(view: view)
34+
SentrySDK.replay.unmaskView(view: label)
3535
```
3636
or
3737

3838
```swift
39-
view.sentryReplayRedact()
40-
label.sentryReplayIgnore()
39+
view.sentryReplayMask()
40+
label.sentryReplayUnmask()
4141
```
4242

4343
## SwiftUI
4444

45-
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`.
46-
In order to control the SwiftUI redact process, you first need to disable the default redaction options:
45+
Because of the way SwiftUI is transformed into UIKit, it will often be over-masked. A modifier like `background` uses the same element as an `Image`.
46+
In order to control the SwiftUI masking process, you need to use the `sentryReplayUnmask` and/or `sentryReplayMask` modifiers.
4747

48+
In this example we want to show the message, but not the user name.
4849
```swift
49-
options.experimental.sessionReplay.redactAllText = false
50-
options.experimental.sessionReplay.redactAllImages = false
50+
@Binding var user: String
51+
52+
var body: some View {
53+
VStack {
54+
Text("Hello")
55+
.sentryReplayUnmask()
56+
Text("\(user)")
57+
}
58+
}
5159
```
5260

53-
Then you can manually choose which `View` you want to redact with the `replayRedact` modifier:
61+
In this example, we need to unmask the VStack because its background element will be masked by default.
62+
To hide the username, we need to mask it.
63+
64+
```swift
65+
@Binding var user: String
5466

55-
```swift
56-
var body: some View {
57-
Text("Hello, World!")
58-
.sentryReplayRedact()
67+
var body: some View {
68+
VStack {
69+
Text("Hello")
70+
Text("\(user)")
71+
.sentrtReplayMask()
5972
}
73+
.background(.blue)
74+
.sentryReplayUnmask()
75+
}
6076
```
6177

62-
<Note>
63-
Disabling the default redaction options will expose all text and images in the session replay.
64-
Make sure to redact them manually.
65-
</Note>
78+
<Alert>
79+
80+
Before publising an App with Session Replay enabled, make sure to test it thoroughly to ensure that no sensitive data is exposed.
6681

82+
</Alert>

docs/platforms/apple/guides/ios/session-replay/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ Sampling begins as soon as a session starts. `sessionSampleRate` is evaluated fi
7373

7474
## Privacy
7575

76-
The SDK aggressively records and redacts all text and images.
76+
The SDK aggressively records the app and masks all text and images.
7777
Please don't turn it off if you have sensitive data in your app.
78-
If you want to manually redact parts of your app's data, read our guide on [custom redaction](/platforms/apple/guides/ios/session-replay/customredact).
78+
If you want to manually mask parts of your app's data, read our guide on [custom masking](/platforms/apple/guides/ios/session-replay/customredact).
7979

8080
<Note>
8181

0 commit comments

Comments
 (0)