Skip to content

Commit

Permalink
RN: Session Replay Privacy Config
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-saia-datadog authored and jonathanmos committed Dec 18, 2024
1 parent 6fa03ae commit 542bfdb
Showing 1 changed file with 136 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 >}}
Expand Down Expand Up @@ -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 >}}
Expand Down Expand Up @@ -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 >}}
Expand Down Expand Up @@ -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 >}}
Expand Down Expand Up @@ -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 >}}
Expand Down Expand Up @@ -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 >}}
Expand Down Expand Up @@ -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 >}}
Expand Down Expand Up @@ -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 >}}
Expand Down

0 comments on commit 542bfdb

Please sign in to comment.