You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/replay/README.md
+32-25Lines changed: 32 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -14,27 +14,14 @@
14
14
15
15
## Pre-requisites
16
16
17
-
For the sentry-replay integration to work, you must have the [Sentry browser SDK package](https://www.npmjs.com/package/@sentry/browser), or an equivalent framework SDK (e.g. [@sentry/react](https://www.npmjs.com/package/@sentry/react)) installed. The minimum version required for the SDK is `7.24.0`.
18
-
19
-
Make sure to use the exact same version of `@sentry/replay` as your other Sentry package(s), e.g. `@sentry/browser` or `@sentry/react`.
20
-
21
17
`@sentry/replay` requires Node 12+, and browsers newer than IE11.
22
18
23
19
## Installation
24
20
25
-
Install the Replay package with NPM or your favourite package manager. Alternatively, you can load the Replay integration via a [CDN bundle](#loading-replay-as-a-cdn-bundle).
26
-
27
-
with npm:
28
-
29
-
```shell
30
-
npm install --save @sentry/browser @sentry/replay
31
-
```
32
-
33
-
with yarn:
21
+
Replay can be imported from `@sentry/browser`, or a respective SDK package like `@sentry/react` or `@sentry/vue`.
22
+
You don't need to install anything in order to use Session Replay. The minimum version that includes Replay is 7.27.0.
34
23
35
-
```shell
36
-
yarn add @sentry/browser @sentry/replay
37
-
```
24
+
For details on using Replay when using Sentry via the CDN bundles, see [CDN bundle](#loading-replay-as-a-cdn-bundle).
38
25
39
26
## Setup
40
27
@@ -43,7 +30,7 @@ See the [configuration section](#configuration) below for more details.
43
30
44
31
```javascript
45
32
import*asSentryfrom'@sentry/browser';
46
-
import{ Replay }from'@sentry/replay';
33
+
// or e.g. import * as Sentry from '@sentry/react';
47
34
48
35
Sentry.init({
49
36
dsn:'__DSN__',
@@ -57,7 +44,7 @@ Sentry.init({
57
44
replaysOnErrorSampleRate:1.0,
58
45
59
46
integrations: [
60
-
newReplay({
47
+
newSentry.Replay({
61
48
// Additional SDK configuration goes in here, for example:
62
49
maskAllText:true,
63
50
blockAllMedia:true
@@ -68,6 +55,23 @@ Sentry.init({
68
55
});
69
56
```
70
57
58
+
### Lazy loading Replay
59
+
60
+
Replay will start automatically when you add the integration.
61
+
If you do not want to start Replay immediately (e.g. if you want to lazy-load it),
62
+
you can also use `addIntegration` to load it later:
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`](https://docs.sentry.io/platforms/javascript/enriching-events/identify-user/).
@@ -77,16 +81,19 @@ import * as Sentry from "@sentry/browser";
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()`.
86
+
You can manually stop/re-start Replay capture via `.stop()`& `.start()`:
83
87
84
-
```javascript
85
-
constreplay=newReplay(); // This will *NOT* begin recording replays
0 commit comments