-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add RN Replay Privacy page #11798
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
Merged
krystofwoldrich
merged 4 commits into
master
from
kw/replay/add-privacy-for-react-native
Nov 26, 2024
Merged
Add RN Replay Privacy page #11798
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
docs/platforms/react-native/session-replay/privacy/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| --- | ||
| title: Privacy | ||
| sidebar_order: 5501 | ||
| notSupported: | ||
| description: "Learn how to mask parts of your app's data in Session Replay." | ||
krystofwoldrich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
|
|
||
| <Alert> | ||
|
|
||
| Using custom masking in your Session Replays may accidentally expose sensitive customer data. Before publishing an App with Session Replay enabled, make sure to test it thoroughly to ensure that no sensitive data is exposed. | ||
|
|
||
| </Alert> | ||
krystofwoldrich marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| By default, our Session Replay SDK masks all text content, images, webviews, and user input. This helps ensure that no sensitive data is exposed. You can also manually choose which parts of your app's data you want to mask by using the different options listed below. | ||
|
|
||
| To disable the default masking behavior (not to be used on applications with sensitive data): | ||
|
|
||
| ```javascript | ||
| Sentry.mobileReplayIntegration({ | ||
| maskAllText: false, | ||
| maskAllImages: false, | ||
| maskAllVectors: false, | ||
| }), | ||
| ``` | ||
|
|
||
| _Make sure your Sentry React Native SDK version is at least 5.36.0 or 6.3.0._ | ||
|
|
||
krystofwoldrich marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Mask and Unmask Components | ||
krystofwoldrich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| You can choose which views you want to mask or unmask by using the `Mask` or `Unmask` components. | ||
|
|
||
| ```jsx | ||
| import * as Sentry from '@sentry/react-native'; | ||
|
|
||
| const Example = () => { | ||
| return ( | ||
| <View> | ||
| <Sentry.Unmask> | ||
| <Text>This will be unmasked</Text> | ||
| </Sentry.Unmask> | ||
| <Sentry.Mask> | ||
| <Text>This will be masked</Text> | ||
| </Sentry.Mask> | ||
| </View> | ||
| ); | ||
| } | ||
| ``` | ||
|
|
||
| ## General Masking Rules | ||
|
|
||
| When components are wrapped by `Unmask`, **only direct children will be unmasked**. You'll need to explicitly wrap each further child if you want them to appear in the replay. | ||
krystofwoldrich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```jsx | ||
| <Sentry.Unmask> | ||
| <Text> | ||
| This will be unmasked | ||
| <Text> | ||
| This will be masked | ||
| </Text> | ||
| </Text> | ||
| <Text> | ||
| This will be unmasked | ||
| </Text> | ||
| </Sentry.Unmask> | ||
| ``` | ||
|
|
||
| When components are wrapped by `Mask`, **all children will be masked**. | ||
|
|
||
| ```jsx | ||
| <Sentry.Mask> | ||
| <Text> | ||
| This will be masked | ||
| <Text> | ||
| This will be masked | ||
| </Text> | ||
| </Text> | ||
| <Text> | ||
| This will be masked | ||
| </Text> | ||
| </Sentry.Mask> | ||
| ``` | ||
|
|
||
| ### Masking Priority | ||
|
|
||
| If a view is marked as masked, it will always be masked, even if it's a child of an unmasked view. | ||
|
|
||
| ```jsx | ||
| <Sentry.Mask> | ||
| <Text>This will be masked</Text> | ||
| <Sentry.Unmask> | ||
| <Text>This will be masked</Text> | ||
| </Sentry.Unmask> | ||
| </Sentry.Mask> | ||
| ``` | ||
|
|
||
| The `Mask` component can't be unmasked. | ||
|
|
||
| ```jsx | ||
| <Sentry.Unmask> | ||
| <Sentry.Mask> | ||
| <Text>This will be masked</Text> | ||
| </Sentry.Mask> | ||
| </Sentry.Unmask> | ||
| ``` | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| The `Mask` and `Unmask` components are native components on iOS and Android and are compatible with both the New Architecture and the Legacy Architecture. | ||
|
|
||
| The masking components behave as standard React Native `View` components. | ||
|
|
||
| If you are experiencing issues with unmasking more than one level deep, check if the wrapped components are present in the native views hierarchy. If not your view were evaluated by React Native to be flattened. Read more about [flattening views](https://reactnative.dev/architecture/view-flattening) in the React Native documentation. | ||
krystofwoldrich marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.