@sentry/replay 7.34.0-beta.0 → 7.35.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 +30 -17
- package/cjs/index.js +492 -294
- package/cjs/index.js.map +1 -1
- package/esm/index.js +493 -295
- 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/addBreadcrumbEvent.d.ts.map +1 -1
- package/types/coreHandlers/handleScope.d.ts.map +1 -1
- package/types/eventBuffer/EventBufferArray.d.ts +19 -0
- package/types/eventBuffer/EventBufferArray.d.ts.map +1 -0
- package/types/eventBuffer/EventBufferCompressionWorker.d.ts +42 -0
- package/types/eventBuffer/EventBufferCompressionWorker.d.ts.map +1 -0
- package/types/eventBuffer/EventBufferProxy.d.ts +33 -0
- package/types/eventBuffer/EventBufferProxy.d.ts.map +1 -0
- package/types/eventBuffer/WorkerHandler.d.ts +27 -0
- package/types/eventBuffer/WorkerHandler.d.ts.map +1 -0
- package/types/eventBuffer/index.d.ts +10 -0
- package/types/eventBuffer/index.d.ts.map +1 -0
- package/types/integration.d.ts +9 -4
- package/types/integration.d.ts.map +1 -1
- package/types/replay.d.ts +4 -6
- package/types/replay.d.ts.map +1 -1
- package/types/session/getSession.d.ts.map +1 -1
- package/types/types/rrweb.d.ts +1 -0
- package/types/types/rrweb.d.ts.map +1 -1
- package/types/types.d.ts +54 -9
- package/types/types.d.ts.map +1 -1
- package/types/util/addEvent.d.ts.map +1 -1
- package/types/util/getPrivacyOptions.d.ts +19 -0
- package/types/util/getPrivacyOptions.d.ts.map +1 -0
- package/types/util/sendReplayRequest.d.ts.map +1 -1
- package/types/eventBuffer.d.ts +0 -97
- package/types/eventBuffer.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ Sentry.setUser({ email: "jane.doe@example.com" });
|
|
|
83
83
|
|
|
84
84
|
### Stopping & re-starting replays
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
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()`.
|
|
87
87
|
|
|
88
88
|
```js
|
|
89
89
|
const replay = new Replay();
|
|
@@ -91,9 +91,12 @@ Sentry.init({
|
|
|
91
91
|
integrations: [replay]
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
replay
|
|
94
|
+
const client = getClient();
|
|
95
|
+
|
|
96
|
+
// Add replay integration, will start recoring
|
|
97
|
+
client.addIntegration(replay);
|
|
98
|
+
|
|
99
|
+
replay.stop(); // Stop recording
|
|
97
100
|
```
|
|
98
101
|
|
|
99
102
|
## Loading Replay as a CDN Bundle
|
|
@@ -185,19 +188,29 @@ The following options can be configured as options to the integration, in `new R
|
|
|
185
188
|
|
|
186
189
|
The following options can be configured as options to the integration, in `new Replay({})`:
|
|
187
190
|
|
|
188
|
-
| key | type | default
|
|
189
|
-
| ---------------- | ------------------------ | -----------------------------------
|
|
190
|
-
| maskAllText | boolean | `true`
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
200
|
-
|
|
191
|
+
| key | type | default | description |
|
|
192
|
+
| ---------------- | ------------------------ | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
193
|
+
| maskAllText | boolean | `true` | Mask _all_ text content. Will pass text content through `maskTextFn` before sending to server. |
|
|
194
|
+
| maskAllInputs | boolean | `true` | Mask values of `<input>` elements. Passes input values through `maskInputFn` before sending to server. |
|
|
195
|
+
| blockAllMedia | boolean | `true` | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`)
|
|
196
|
+
| maskTextFn | (text: string) => string | `(text) => '*'.repeat(text.length)` | Function to customize how text content is masked before sending to server. By default, masks text with `*`. |
|
|
197
|
+
| block | Array<string> | `.sentry-block, [data-sentry-block]` | Redact any elements that match the DOM selectors. See [privacy](#blocking) section for an example. |
|
|
198
|
+
| unblock | Array<string> | `.sentry-unblock, [data-sentry-unblock]`| Do not redact any elements that match the DOM selectors. Useful when using `blockAllMedia`. See [privacy](#blocking) section for an example. |
|
|
199
|
+
| mask | Array<string> | `.sentry-mask, [data-sentry-mask]` | Mask all elements that match the given DOM selectors. See [privacy](#masking) section for an example. |
|
|
200
|
+
| unmask | Array<string> | `.sentry-unmask, [data-sentry-unmask]` | Unmask all elements that match the given DOM selectors. Useful when using `maskAllText`. See [privacy](#masking) section for an example. |
|
|
201
|
+
| ignore | Array<string> | `.sentry-ignore, [data-sentry-ignore]` | Ignores all events on the matching input fields. See [privacy](#ignoring) section for an example. |
|
|
202
|
+
|
|
203
|
+
#### Deprecated options
|
|
204
|
+
In order to streamline our privacy options, the following have been deprecated in favor for the respective options above.
|
|
205
|
+
|
|
206
|
+
| deprecated key | replaced by | description |
|
|
207
|
+
| ---------------- | ----------- | ----------- |
|
|
208
|
+
| maskInputOptions | mask | Use CSS selectors in `mask` in order to mask all inputs of a certain type. For example, `input[type="address"]` |
|
|
209
|
+
| blockSelector | block | The selector(s) can be moved directly in the `block` array. |
|
|
210
|
+
| blockClass | block | Convert the class name to a CSS selector and add to `block` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |
|
|
211
|
+
| maskClass | mask | Convert the class name to a CSS selector and add to `mask` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |
|
|
212
|
+
| maskSelector | mask | The selector(s) can be moved directly in the `mask` array. |
|
|
213
|
+
| ignoreClass | ignore | Convert the class name to a CSS selector and add to `ignore` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |
|
|
201
214
|
|
|
202
215
|
## Privacy
|
|
203
216
|
There are several ways to deal with 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 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.
|