Skip to content

Commit f1d12d6

Browse files
authored
replay: config restructure (#5927)
1 parent 7817db9 commit f1d12d6

File tree

17 files changed

+65
-111
lines changed

17 files changed

+65
-111
lines changed

src/platform-includes/session-replay/setup-session-replay/javascript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
To set up the integration, add the following to your Sentry initialization. Several options are supported and passable via the integration constructor. See the [configuration sections](/platforms/javascript/session-replay/custom-instrumentation/) for more details.
1+
To set up the integration, add the following to your Sentry initialization. Several options are supported and passable via the integration constructor. See the [configuration sections](/platforms/javascript/session-replay/) for more details.
22

33
```javascript {tabTitle: ESM}
44
// import Sentry from your framework SDK (e.g. @sentry/react) instead of @sentry/browser
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
---
2-
title: General Configuration
2+
title: Configuration
33
sidebar_order: 410
4-
supported:
5-
- javascript
6-
- javascript.angular
7-
- javascript.ember
8-
- javascript.gatsby
9-
- javascript.nextjs
10-
- javascript.react
11-
- javascript.remix
12-
- javascript.svelte
13-
- javascript.vue
144
notSupported:
155
- javascript.capacitor
166
- javascript.cordova
@@ -21,35 +11,6 @@ description: "Learn about the general Session Replay configuration fields."
2111

2212
<Include name="beta-note-session-replay.mdx" />
2313

24-
## Identifying Users
25-
26-
If you have only followed the above instructions to setup session replays, you will only see IP addresses in Sentry's UI. In order to associate a user identity to a session replay, use [setUser](/platforms/javascript/enriching-events/identify-user/).
27-
28-
```javascript
29-
import * as Sentry from "@sentry/browser";
30-
Sentry.setUser({ email: "[email protected]" });
31-
```
32-
33-
## Start and Stop Recording
34-
35-
Replay recording only starts automatically when it is included in the integrations key when calling Sentry.init. Otherwise you can initialize the plugin and manually call the start() method on the integration instance. To stop recording you can call the stop().
36-
37-
```javascript {tabTitle: ESM}
38-
const replay = new Replay(); // This will *NOT* begin recording replays
39-
40-
replay.start(); // Start recording
41-
42-
replay.stop(); // Stop recording
43-
```
44-
45-
```javascript {tabTitle: CDN}
46-
const replay = new Sentry.Integrations.Replay(); // This will *NOT* begin recording replays
47-
48-
replay.start(); // Start recording
49-
50-
replay.stop(); // Stop recording
51-
```
52-
5314
## General Integration Configuration
5415

5516
The following options can be configured on the root level of your browser-based Sentry SDK, in `init({})`:
@@ -75,6 +36,14 @@ The following options can be configured as options to the integration, in `new R
7536
| inlineImages | boolean | `false` | Should inline `<image>` content |
7637
| inlineStylesheet | boolean | `true` | Should inline stylesheets used in the recording |
7738

39+
## Identifying Users
40+
41+
You can use the Sentry SDK to set the user of a session. To associate a user identity to a session replay, refer to the <PlatformLink to="/enriching-events/identify-user">Identifying User Docs</PlatformLink>.
42+
43+
```javascript
44+
Sentry.setUser({ email: "[email protected]" });
45+
```
46+
7847
## rrweb Configuration
7948

8049
In addition to the options described above, you can also directly pass configuration to [rrweb](https://github.com/rrweb-io/rrweb/blob/rrweb%401.1.3/guide.md), which is the underlying library used to make the recordings:
@@ -84,3 +53,27 @@ new Replay({
8453
// any further configuration here is passed directly to rrweb
8554
});
8655
```
56+
57+
## Start and Stop Recording
58+
59+
Replay recording only starts automatically when it's included in the integrations key when calling `Sentry.init`. Otherwise, you can initialize the plugin and manually call the `start()` method on the integration instance. To stop recording you can call the `stop()`:
60+
61+
```javascript {tabTitle: ESM}
62+
const replay = new Replay(); // This will *NOT* begin recording replays
63+
64+
replay.start(); // Start recording
65+
66+
replay.stop(); // Stop recording
67+
```
68+
69+
```javascript {tabTitle: CDN}
70+
const replay = new Sentry.Integrations.Replay(); // This will *NOT* begin recording replays
71+
72+
replay.start(); // Start recording
73+
74+
replay.stop(); // Stop recording
75+
```
76+
77+
## Privacy
78+
79+
We take privacy seriously so we provide a number of privacy-oriented settings. Learn more about these in our our<PlatformLink to="/session-replay/privacy/#privacy-configuration">Session Replay privacy documentation</PlatformLink>.

src/platforms/javascript/common/session-replay/custom-instrumentation/index.mdx

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/platforms/javascript/common/session-replay/index.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
---
22
title: Set Up Session Replay
33
sidebar_order: 4000
4-
supported:
5-
- javascript
6-
- javascript.angular
7-
- javascript.ember
8-
- javascript.gatsby
9-
- javascript.nextjs
10-
- javascript.react
11-
- javascript.remix
12-
- javascript.svelte
13-
- javascript.vue
144
notSupported:
155
- javascript.capacitor
166
- javascript.cordova
@@ -35,6 +25,8 @@ redirect_from:
3525

3626
<Include name="beta-note-session-replay.mdx" />
3727

28+
Sentry's Replay product is geared toward developers. By default, it'll mask all fields, so no personally identifiable information (PII) is collected, eliminating any concerns with General Data Protection Regulation (GDPR). Learn more on <PlatformLink to="/session-replay/privacy">Session Replay Privacy</PlatformLink>.
29+
3830
With [session replays](/product/session-replay/) you can get to the root cause of an error or latency issue faster by seeing all the technical details related to that issue in one visual replay on your web application. Sentry provides a video-like reproduction of user interactions on a site or web app. All user interactions - including page visits, mouse movements, clicks, and scrolls - are captured, helping developers connect the dots between a known issue and how a user experienced it in the UI.
3931

4032
## Pre-requisites
Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
---
2-
title: Privacy Configuration
2+
title: Privacy
33
sidebar_order: 4200
4-
supported:
5-
- javascript
6-
- javascript.angular
7-
- javascript.ember
8-
- javascript.gatsby
9-
- javascript.nextjs
10-
- javascript.react
11-
- javascript.remix
12-
- javascript.svelte
13-
- javascript.vue
144
notSupported:
155
- javascript.capacitor
166
- javascript.cordova
@@ -21,9 +11,10 @@ description: "Configuring Session Replay to maintain user and data privacy."
2111

2212
<Include name="beta-note-session-replay.mdx" />
2313

24-
There are several ways to deal with PII (personally identifiable information). By default, the integration will mask all text content with `*` and block all media elements (`img, svg, video, object, picture, embed, map, audio`). This can be disabled by setting `maskAllText` to `false`. It is also possible to add the following CSS classes to specific DOM elements to prevent recording its contents: `sentry-block`, `sentry-ignore`, and `sentry-mask`. The following sections will show examples of how content is handled by the differing methods.
14+
There are several ways to deal with personally identifiable information (PII). By default, the integration will mask all text content with `*` and block all media elements (`img`, `svg`, `video`, `object`, `picture`, `embed`, `map`, `audio`). This can be disabled by setting `maskAllText` to `false`. It's also possible to add the following CSS classes to specific DOM elements to prevent recording their contents: `sentry-block`, `sentry-ignore`, and `sentry-mask`. The following sections will show examples of how content is handled by the differing methods.
2515

2616
### Masking
17+
2718
Masking replaces the text content with something else. The default masking behavior is to replace each character with a `*`. In this example the relevant html code is: `<table class="sentry-mask">...</table>`.
2819
![Masking example](./session-replay-masking.png)
2920

src/wizard/javascript/replay-onboarding/angular/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/angular/session-replay/custom-instrumentation/).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/angular/session-replay/).
1111

1212
```javascript
1313
import * as Sentry from "@sentry/angular";
1414
import { Replay } from "@sentry/replay";
1515

1616
Sentry.init({
17-
dsn: "https://[email protected]/0",
17+
dsn: "___PUBLIC_DSN___",
1818

1919
// This sets the sample rate to be 10%. You may want this to be 100% while
2020
// in development and sample at a lower rate in production

src/wizard/javascript/replay-onboarding/ember/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/ember/session-replay/custom-instrumentation/).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/ember/session-replay/).
1111

1212
```javascript
1313
import * as Sentry from "@sentry/ember";
1414
import { Replay } from "@sentry/replay";
1515

1616
Sentry.init({
17-
dsn: "https://[email protected]/0",
17+
dsn: "___PUBLIC_DSN___",
1818

1919
// This sets the sample rate to be 10%. You may want this to be 100% while
2020
// in development and sample at a lower rate in production

src/wizard/javascript/replay-onboarding/gatsby/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/gatsby/session-replay/custom-instrumentation/).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/gatsby/session-replay/).
1111

1212
Include the `@sentry/gatsby` plugin:
1313

@@ -28,7 +28,7 @@ import * as Sentry from "@sentry/gatsby";
2828
import { Replay } from "@sentry/replay";
2929

3030
Sentry.init({
31-
dsn: "https://[email protected]/0",
31+
dsn: "___PUBLIC_DSN___",
3232

3333
// This sets the sample rate to be 10%. You may want this to be 100% while
3434
// in development and sample at a lower rate in production

src/wizard/javascript/replay-onboarding/javascript/2.configure.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay in our Github [Readme](https://github.com/getsentry/sentry-replay/blob/main/README.md).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/session-replay/).
1111

1212
```javascript
1313
import * as Sentry from "@sentry/browser";
1414
import { Replay } from "@sentry/replay";
1515

1616
Sentry.init({
1717
dsn: "https://[email protected]/0",
18-
integrations: [
19-
new Replay({
20-
// Capture 10% of all sessions
21-
sessionSampleRate: 0.1,
18+
19+
// This sets the sample rate to be 10%. You may want this to be 100% while
20+
// in development and sample at a lower rate in production
21+
replaysSessionSampleRate: 0.1,
22+
// If the entire session is not sampled, use the below sample rate to sample
23+
// sessions when an error occurs.
24+
replaysOnErrorSampleRate: 1.0,
2225

23-
// Of the remaining 90% of sessions, if an error happens start capturing
24-
errorSampleRate: 1.0,
25-
})
26+
integrations: [
27+
new Replay()
2628
],
2729
});
2830
```

src/wizard/javascript/replay-onboarding/nextjs/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/nextjs/session-replay/custom-instrumentation/).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/nextjs/session-replay/).
1111

1212
```javascript {filename:sentry.client.config.js}
1313
import * as Sentry from "@sentry/nextjs";
1414
import { Replay } from "@sentry/replay";
1515

1616
Sentry.init({
17-
dsn: "https://[email protected]/0",
17+
dsn: "___PUBLIC_DSN___",
1818

1919
// This sets the sample rate to be 10%. You may want this to be 100% while
2020
// in development and sample at a lower rate in production

src/wizard/javascript/replay-onboarding/react/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/react/session-replay/custom-instrumentation/).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/react/session-replay/).
1111

1212
```javascript
1313
import * as Sentry from "@sentry/react";
1414
import { Replay } from "@sentry/replay";
1515

1616
Sentry.init({
17-
dsn: "https://[email protected]/0",
17+
dsn: "___PUBLIC_DSN___",
1818

1919
// This sets the sample rate to be 10%. You may want this to be 100% while
2020
// in development and sample at a lower rate in production

src/wizard/javascript/replay-onboarding/remix/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/remix/session-replay/custom-instrumentation/).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/remix/session-replay/).
1111

1212
```javascript {filename: entry.client.tsx}
1313
import * as Sentry from "@sentry/remix";
1414
import { Replay } from "@sentry/replay";
1515

1616
Sentry.init({
17-
dsn: "https://[email protected]/0",
17+
dsn: "___PUBLIC_DSN___",
1818

1919
// This sets the sample rate to be 10%. You may want this to be 100% while
2020
// in development and sample at a lower rate in production

src/wizard/javascript/replay-onboarding/svelte/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/svelte/session-replay/custom-instrumentation/).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/svelte/session-replay/).
1111

1212
```javascript
1313
import "./app.css";
@@ -17,7 +17,7 @@ import * as Sentry from "@sentry/svelte";
1717
import { Replay } from "@sentry/replay";
1818

1919
Sentry.init({
20-
dsn: "https://[email protected]/0",
20+
dsn: "___PUBLIC_DSN___",
2121

2222
// This sets the sample rate to be 10%. You may want this to be 100% while
2323
// in development and sample at a lower rate in production

src/wizard/javascript/replay-onboarding/vue/2.configure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: language
77

88
#### Configure
99

10-
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/vue/session-replay/custom-instrumentation/).
10+
Add the following to your SDK config. There are several privacy and sampling options available, all of which can be set via the `integrations` constructor. Learn more about configuring Session Replay by reading the [configuration docs](https://docs.sentry.io/platforms/javascript/guides/vue/session-replay/).
1111

1212
#### Vue 2
1313

@@ -25,7 +25,7 @@ const router = new Router({
2525

2626
Sentry.init({
2727
Vue,
28-
dsn: "https://[email protected]/0",
28+
dsn: "___PUBLIC_DSN___",
2929

3030
// This sets the sample rate to be 10%. You may want this to be 100% while
3131
// in development and sample at a lower rate in production

0 commit comments

Comments
 (0)