@sentry/replay 7.49.0 → 7.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -6
- package/cjs/index.js +541 -209
- package/cjs/index.js.map +1 -1
- package/esm/index.js +542 -210
- package/esm/index.js.map +1 -1
- package/package.json +5 -5
- package/types/constants.d.ts +4 -2
- package/types/constants.d.ts.map +1 -1
- package/types/coreHandlers/handleAfterSendEvent.d.ts.map +1 -1
- package/types/coreHandlers/handleNetworkBreadcrumbs.d.ts.map +1 -1
- package/types/coreHandlers/handleScope.d.ts +2 -0
- package/types/coreHandlers/handleScope.d.ts.map +1 -1
- package/types/coreHandlers/util/fetchUtils.d.ts.map +1 -1
- package/types/coreHandlers/util/networkUtils.d.ts +4 -0
- package/types/coreHandlers/util/networkUtils.d.ts.map +1 -1
- package/types/coreHandlers/util/xhrUtils.d.ts.map +1 -1
- package/types/eventBuffer/EventBufferArray.d.ts +5 -1
- package/types/eventBuffer/EventBufferArray.d.ts.map +1 -1
- package/types/eventBuffer/EventBufferCompressionWorker.d.ts +8 -5
- package/types/eventBuffer/EventBufferCompressionWorker.d.ts.map +1 -1
- package/types/eventBuffer/EventBufferProxy.d.ts +5 -1
- package/types/eventBuffer/EventBufferProxy.d.ts.map +1 -1
- package/types/integration.d.ts +21 -14
- package/types/integration.d.ts.map +1 -1
- package/types/replay.d.ts +35 -12
- package/types/replay.d.ts.map +1 -1
- package/types/session/Session.d.ts +0 -4
- package/types/session/Session.d.ts.map +1 -1
- package/types/session/clearSession.d.ts +6 -0
- package/types/session/clearSession.d.ts.map +1 -0
- package/types/session/createSession.d.ts +6 -2
- package/types/session/createSession.d.ts.map +1 -1
- package/types/session/getSession.d.ts +1 -1
- package/types/session/getSession.d.ts.map +1 -1
- package/types/types.d.ts +68 -45
- package/types/types.d.ts.map +1 -1
- package/types/util/addEvent.d.ts.map +1 -1
- package/types/util/addGlobalListeners.d.ts.map +1 -1
- package/types/util/timestampToMs.d.ts +5 -0
- package/types/util/timestampToMs.d.ts.map +1 -0
package/README.md
CHANGED
|
@@ -86,9 +86,9 @@ import * as Sentry from "@sentry/browser";
|
|
|
86
86
|
Sentry.setUser({ email: "jane.doe@example.com" });
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
### Stopping &
|
|
89
|
+
### Stopping & starting Replays manually
|
|
90
90
|
|
|
91
|
-
Replay recording only starts when it is included in the `integrations` array when calling `Sentry.init` or calling `addIntegration` from the a Sentry client instance. To stop recording you can call
|
|
91
|
+
Replay recording only starts when it is included in the `integrations` array when calling `Sentry.init` or calling `addIntegration` from the a Sentry client instance. To stop recording you can call `stop()`.
|
|
92
92
|
|
|
93
93
|
```js
|
|
94
94
|
import * as Sentry from "@sentry/react";
|
|
@@ -109,6 +109,16 @@ client?.addIntegration(replay);
|
|
|
109
109
|
replay.stop();
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
When both `replaysSessionSampleRate` and `replaysOnErrorSampleRate` are `0`, recording will _not_ start.
|
|
113
|
+
In this case, you can manually start recording:
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
replay.start(); // Will start a session in "session" mode, regardless of sample rates
|
|
117
|
+
replay.startBuffering(); // Will start a session in "buffer" mode, regardless of sample rates
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
112
122
|
## Loading Replay as a CDN Bundle
|
|
113
123
|
|
|
114
124
|
As an alternative to the NPM package, you can use Replay as a CDN bundle.
|
|
@@ -154,8 +164,11 @@ Sampling allows you to control how much of your website's traffic will result in
|
|
|
154
164
|
- `replaysSessionSampleRate` - The sample rate for replays that begin recording immediately and last the entirety of the user's session.
|
|
155
165
|
- `replaysOnErrorSampleRate` - The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends.
|
|
156
166
|
|
|
157
|
-
|
|
158
|
-
|
|
167
|
+
When Replay is initialized, we check the `replaysSessionSampleRate`.
|
|
168
|
+
If it is sampled, then we start recording & sending Replay data immediately.
|
|
169
|
+
Else, if `replaysOnErrorSampleRate > 0`, we'll start recording in buffering mode.
|
|
170
|
+
In this mode, whenever an error occurs we'll check `replaysOnErrorSampleRate`.
|
|
171
|
+
If it is sampled, when we'll upload the Replay to Sentry and continue recording normally.
|
|
159
172
|
|
|
160
173
|
## Configuration
|
|
161
174
|
|
|
@@ -234,5 +247,5 @@ This should not happen to often, but be aware that it is theoretically possible.
|
|
|
234
247
|
## Manually sending replay data
|
|
235
248
|
|
|
236
249
|
You can use `replay.flush()` to immediately send all currently captured replay data.
|
|
237
|
-
|
|
238
|
-
|
|
250
|
+
When Replay is currently in buffering mode, this will send up to the last 60 seconds of replay data,
|
|
251
|
+
and also continue sending afterwards, similar to when an error happens & is recorded.
|