Skip to content
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

[RELEASE] React Native SDK v2.6.1 #769

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion packages/react-native-session-replay/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
# Session Replay for React Native

Session Replay for React Native is not available yet.
Mobile Session Replay expands visibility into your mobile applications by visually replaying each user interaction, such as taps, swipes, and scrolls. Visually replaying user interactions on your applications makes it easier to reproduce crashes and errors, as well as understand the user journey for making UI improvements.

## Setup

**Note:** Make sure you’ve setup and initialized the [Datadog React Native SDK][1] with views instrumentation enabled.

To install with NPM, run:

```sh
npm install @datadog/mobile-react-native-session-replay
```

To install with Yarn, run:

```sh
yarn add @datadog/mobile-react-native-session-replay
```

## Enable Session Replay

To enable Session Replay, import and call the `enable` method with your configuration. Below is an example setup:

```js
import { SessionReplay } from "@datadog/mobile-react-native-session-replay";

SessionReplay.enable({
replaySampleRate: sampleRate // The percentage of sampled replays, in the range 0.0 - 100.0 (Default: 100.0).
textAndInputPrivacyLevel: TextAndInputPrivacyLevel.MASK_ALL, // Defines the way text and input (e.g text fields, checkboxes) should be masked (Default: `MASK_ALL`).
imagePrivacyLevel: ImagePrivacyLevel.MASK_ALL, // Defines the way images should be masked (Default: `MASK_ALL`).
touchPrivacyLevel: TouchPrivacyLevel.HIDE // Defines the way user touches (e.g tap) should be masked (Default: `HIDE`).
});
```

**Note:**: All configuration properties are optional and should be adjusted based on your application's needs.

## Start or stop the recording manually

By default, Session Replay starts recording automatically. However, if you prefer to manually start recording at a specific point in your application, you can use the optional `startRecordingImmediately` parameter as shown below, and later call `SessionReplay.startRecording()`. You can also use `SessionReplay.stopRecording()` to stop the recording anytime.

```js
import { SessionReplay } from "@datadog/mobile-react-native-session-replay";

SessionReplay.enable({
replaySampleRate: sampleRate,
startRecordingImmediately: false
});
// Do something
SessionReplay.startRecording();
SessionReplay.stopRecording();
```

[1]: https://www.npmjs.com/package/@datadog/mobile-react-native
2 changes: 1 addition & 1 deletion packages/react-native-session-replay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"source": "src",
"module": "lib/module/index",
"publishConfig": {
"access": "restricted"
"access": "public"
},
"scripts": {
"test": "jest",
Expand Down
Loading