@sentry/replay 7.45.0 → 7.47.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 +16 -4
- package/cjs/index.js +443 -211
- package/cjs/index.js.map +1 -1
- package/esm/index.js +444 -212
- package/esm/index.js.map +1 -1
- package/package.json +5 -5
- package/types/constants.d.ts +1 -0
- package/types/constants.d.ts.map +1 -1
- package/types/coreHandlers/handleFetch.d.ts +2 -2
- package/types/coreHandlers/handleFetch.d.ts.map +1 -1
- package/types/coreHandlers/handleHistory.d.ts.map +1 -1
- package/types/coreHandlers/handleNetworkBreadcrumbs.d.ts +5 -11
- package/types/coreHandlers/handleNetworkBreadcrumbs.d.ts.map +1 -1
- package/types/coreHandlers/handleXhr.d.ts +2 -2
- package/types/coreHandlers/handleXhr.d.ts.map +1 -1
- package/types/coreHandlers/{addBreadcrumbEvent.d.ts → util/addBreadcrumbEvent.d.ts} +1 -1
- package/types/coreHandlers/util/addBreadcrumbEvent.d.ts.map +1 -0
- package/types/coreHandlers/util/addNetworkBreadcrumb.d.ts +4 -0
- package/types/coreHandlers/util/addNetworkBreadcrumb.d.ts.map +1 -0
- package/types/coreHandlers/util/fetchUtils.d.ts +24 -0
- package/types/coreHandlers/util/fetchUtils.d.ts.map +1 -0
- package/types/coreHandlers/util/networkUtils.d.ts +15 -0
- package/types/coreHandlers/util/networkUtils.d.ts.map +1 -0
- package/types/coreHandlers/util/xhrUtils.d.ts +23 -0
- package/types/coreHandlers/util/xhrUtils.d.ts.map +1 -0
- package/types/replay.d.ts +2 -0
- package/types/replay.d.ts.map +1 -1
- package/types/types.d.ts +126 -5
- package/types/types.d.ts.map +1 -1
- package/types/util/addMemoryEntry.d.ts.map +1 -1
- package/types/util/createPerformanceEntries.d.ts +2 -2
- package/types/util/createPerformanceEntries.d.ts.map +1 -1
- package/types/util/createPerformanceSpans.d.ts +2 -2
- package/types/util/createPerformanceSpans.d.ts.map +1 -1
- package/types/util/sendReplayRequest.d.ts.map +1 -1
- package/types/coreHandlers/addBreadcrumbEvent.d.ts.map +0 -1
- package/types/coreHandlers/addNetworkBreadcrumb.d.ts +0 -4
- package/types/coreHandlers/addNetworkBreadcrumb.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -60,6 +60,9 @@ If you do not want to start Replay immediately (e.g. if you want to lazy-load it
|
|
|
60
60
|
you can also use `addIntegration` to load it later:
|
|
61
61
|
|
|
62
62
|
```js
|
|
63
|
+
import * as Sentry from "@sentry/react";
|
|
64
|
+
import { BrowserClient } from "@sentry/browser";
|
|
65
|
+
|
|
63
66
|
Sentry.init({
|
|
64
67
|
// Do not load it initially
|
|
65
68
|
integrations: []
|
|
@@ -67,7 +70,10 @@ Sentry.init({
|
|
|
67
70
|
|
|
68
71
|
// Sometime later
|
|
69
72
|
const { Replay } = await import('@sentry/browser');
|
|
70
|
-
getCurrentHub().getClient()
|
|
73
|
+
const client = Sentry.getCurrentHub().getClient<BrowserClient>();
|
|
74
|
+
|
|
75
|
+
// Client can be undefined
|
|
76
|
+
client?.addIntegration(new Replay());
|
|
71
77
|
```
|
|
72
78
|
|
|
73
79
|
### Identifying Users
|
|
@@ -76,6 +82,7 @@ If you have only followed the above instructions to setup session replays, you w
|
|
|
76
82
|
|
|
77
83
|
```javascript
|
|
78
84
|
import * as Sentry from "@sentry/browser";
|
|
85
|
+
|
|
79
86
|
Sentry.setUser({ email: "jane.doe@example.com" });
|
|
80
87
|
```
|
|
81
88
|
|
|
@@ -84,17 +91,22 @@ Sentry.setUser({ email: "jane.doe@example.com" });
|
|
|
84
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 the `stop()`.
|
|
85
92
|
|
|
86
93
|
```js
|
|
94
|
+
import * as Sentry from "@sentry/react";
|
|
95
|
+
import { BrowserClient } from "@sentry/browser";
|
|
96
|
+
|
|
87
97
|
const replay = new Replay();
|
|
98
|
+
|
|
88
99
|
Sentry.init({
|
|
89
100
|
integrations: [replay]
|
|
90
101
|
});
|
|
91
102
|
|
|
92
|
-
const client = getClient();
|
|
103
|
+
const client = Sentry.getCurrentHub().getClient<BrowserClient>();
|
|
93
104
|
|
|
94
105
|
// Add replay integration, will start recoring
|
|
95
|
-
client
|
|
106
|
+
client?.addIntegration(replay);
|
|
96
107
|
|
|
97
|
-
|
|
108
|
+
// Stop recording
|
|
109
|
+
replay.stop();
|
|
98
110
|
```
|
|
99
111
|
|
|
100
112
|
## Loading Replay as a CDN Bundle
|