From 542bfdbe52d8bce2dc6fd16e367b99b722f8e070 Mon Sep 17 00:00:00 2001 From: Marco Saia Date: Mon, 16 Dec 2024 14:10:54 +0100 Subject: [PATCH] RN: Session Replay Privacy Config --- .../session_replay/mobile/privacy_options.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/content/en/real_user_monitoring/session_replay/mobile/privacy_options.md b/content/en/real_user_monitoring/session_replay/mobile/privacy_options.md index ebbfc579e691c..12701aa31aca0 100644 --- a/content/en/real_user_monitoring/session_replay/mobile/privacy_options.md +++ b/content/en/real_user_monitoring/session_replay/mobile/privacy_options.md @@ -62,6 +62,23 @@ With the `mask_sensitive_inputs` setting enabled, all text and inputs are shown ) SessionReplay.enable(with: sessionReplayConfig) +{{< /code-block >}} +{{% /tab %}} +{{% tab "React Native" %}} +{{< code-block lang="typescript" filename="App.tsx" disable_copy="false" collapsible="true" >}} + import { + SessionReplay, + SessionReplayConfiguration, + TextAndInputPrivacyLevel, + } from "@datadog/mobile-react-native-session-replay"; + + const config: SessionReplayConfiguration = { + replaySampleRate: sampleRate, + textAndInputPrivacyLevel: TextAndInputPrivacyLevel.MASK_SENSITIVE_INPUTS, + } + + SessionReplay.enable(config) + {{< /code-block >}} {{% /tab %}} {{< /tabs >}} @@ -91,6 +108,23 @@ With the `mask_all_inputs` setting enabled, all inputs fields are masked in the ) SessionReplay.enable(with: sessionReplayConfig) +{{< /code-block >}} +{{% /tab %}} +{{% tab "React Native" %}} +{{< code-block lang="typescript" filename="App.tsx" disable_copy="false" collapsible="true" >}} + import { + SessionReplay, + SessionReplayConfiguration, + TextAndInputPrivacyLevel, + } from "@datadog/mobile-react-native-session-replay"; + + const config: SessionReplayConfiguration = { + replaySampleRate: sampleRate, + textAndInputPrivacyLevel: TextAndInputPrivacyLevel.MASK_ALL_INPUTS, + } + + SessionReplay.enable(config) + {{< /code-block >}} {{% /tab %}} {{< /tabs >}} @@ -120,6 +154,23 @@ With the `mask_all` setting enabled, all text and input fields are masked in the ) SessionReplay.enable(with: sessionReplayConfig) +{{< /code-block >}} +{{% /tab %}} +{{% tab "React Native" %}} +{{< code-block lang="typescript" filename="App.tsx" disable_copy="false" collapsible="true" >}} + import { + SessionReplay, + SessionReplayConfiguration, + TextAndInputPrivacyLevel, + } from "@datadog/mobile-react-native-session-replay"; + + const config: SessionReplayConfiguration = { + replaySampleRate: sampleRate, + textAndInputPrivacyLevel: TextAndInputPrivacyLevel.MASK_ALL, + } + + SessionReplay.enable(config) + {{< /code-block >}} {{% /tab %}} {{< /tabs >}} @@ -155,6 +206,23 @@ With the `mask_all` setting enabled, all images are replaced by placeholders lab ) SessionReplay.enable(with: sessionReplayConfig) +{{< /code-block >}} +{{% /tab %}} +{{% tab "React Native" %}} +{{< code-block lang="typescript" filename="App.tsx" disable_copy="false" collapsible="true" >}} + import { + SessionReplay, + SessionReplayConfiguration, + ImagePrivacyLevel, + } from "@datadog/mobile-react-native-session-replay"; + + const config: SessionReplayConfiguration = { + replaySampleRate: sampleRate, + imagePrivacyLevel: ImagePrivacyLevel.MASK_ALL, + } + + SessionReplay.enable(config) + {{< /code-block >}} {{% /tab %}} {{< /tabs >}} @@ -200,6 +268,23 @@ On Android, users can select the `mask_large_only` setting, which replaces image ) SessionReplay.enable(with: sessionReplayConfig) +{{< /code-block >}} +{{% /tab %}} +{{% tab "React Native" %}} +{{< code-block lang="typescript" filename="App.tsx" disable_copy="false" collapsible="true" >}} + import { + SessionReplay, + SessionReplayConfiguration, + ImagePrivacyLevel, + } from "@datadog/mobile-react-native-session-replay"; + + const config: SessionReplayConfiguration = { + replaySampleRate: sampleRate, + imagePrivacyLevel: ImagePrivacyLevel.MASK_NON_BUNDLED_ONLY, + } + + SessionReplay.enable(config) + {{< /code-block >}} {{% /tab %}} {{< /tabs >}} @@ -229,6 +314,23 @@ With the `mask_none` setting enabled, all images are shown in the replay. ) SessionReplay.enable(with: sessionReplayConfig) +{{< /code-block >}} +{{% /tab %}} +{{% tab "React Native" %}} +{{< code-block lang="typescript" filename="App.tsx" disable_copy="false" collapsible="true" >}} + import { + SessionReplay, + SessionReplayConfiguration, + ImagePrivacyLevel, + } from "@datadog/mobile-react-native-session-replay"; + + const config: SessionReplayConfiguration = { + replaySampleRate: sampleRate, + imagePrivacyLevel: ImagePrivacyLevel.MASK_NONE, + } + + SessionReplay.enable(config) + {{< /code-block >}} {{% /tab %}} {{< /tabs >}} @@ -261,6 +363,23 @@ With the `hide` setting enabled, all touches that occur during the replay are hi ) SessionReplay.enable(with: sessionReplayConfig) +{{< /code-block >}} +{{% /tab %}} +{{% tab "React Native" %}} +{{< code-block lang="typescript" filename="App.tsx" disable_copy="false" collapsible="true" >}} + import { + SessionReplay, + SessionReplayConfiguration, + TouchPrivacyLevel, + } from "@datadog/mobile-react-native-session-replay"; + + const config: SessionReplayConfiguration = { + replaySampleRate: sampleRate, + touchPrivacyLevel: TouchPrivacyLevel.HIDE, + } + + SessionReplay.enable(config) + {{< /code-block >}} {{% /tab %}} {{< /tabs >}} @@ -290,6 +409,23 @@ With the `show` setting enabled, all touches that occur during the replay are sh ) SessionReplay.enable(with: sessionReplayConfig) +{{< /code-block >}} +{{% /tab %}} +{{% tab "React Native" %}} +{{< code-block lang="typescript" filename="App.tsx" disable_copy="false" collapsible="true" >}} + import { + SessionReplay, + SessionReplayConfiguration, + TouchPrivacyLevel, + } from "@datadog/mobile-react-native-session-replay"; + + const config: SessionReplayConfiguration = { + replaySampleRate: sampleRate, + touchPrivacyLevel: TouchPrivacyLevel.SHOW, + } + + SessionReplay.enable(config) + {{< /code-block >}} {{% /tab %}} {{< /tabs >}}