@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.
Files changed (35) hide show
  1. package/README.md +30 -17
  2. package/cjs/index.js +492 -294
  3. package/cjs/index.js.map +1 -1
  4. package/esm/index.js +493 -295
  5. package/esm/index.js.map +1 -1
  6. package/package.json +5 -5
  7. package/types/constants.d.ts +1 -0
  8. package/types/constants.d.ts.map +1 -1
  9. package/types/coreHandlers/addBreadcrumbEvent.d.ts.map +1 -1
  10. package/types/coreHandlers/handleScope.d.ts.map +1 -1
  11. package/types/eventBuffer/EventBufferArray.d.ts +19 -0
  12. package/types/eventBuffer/EventBufferArray.d.ts.map +1 -0
  13. package/types/eventBuffer/EventBufferCompressionWorker.d.ts +42 -0
  14. package/types/eventBuffer/EventBufferCompressionWorker.d.ts.map +1 -0
  15. package/types/eventBuffer/EventBufferProxy.d.ts +33 -0
  16. package/types/eventBuffer/EventBufferProxy.d.ts.map +1 -0
  17. package/types/eventBuffer/WorkerHandler.d.ts +27 -0
  18. package/types/eventBuffer/WorkerHandler.d.ts.map +1 -0
  19. package/types/eventBuffer/index.d.ts +10 -0
  20. package/types/eventBuffer/index.d.ts.map +1 -0
  21. package/types/integration.d.ts +9 -4
  22. package/types/integration.d.ts.map +1 -1
  23. package/types/replay.d.ts +4 -6
  24. package/types/replay.d.ts.map +1 -1
  25. package/types/session/getSession.d.ts.map +1 -1
  26. package/types/types/rrweb.d.ts +1 -0
  27. package/types/types/rrweb.d.ts.map +1 -1
  28. package/types/types.d.ts +54 -9
  29. package/types/types.d.ts.map +1 -1
  30. package/types/util/addEvent.d.ts.map +1 -1
  31. package/types/util/getPrivacyOptions.d.ts +19 -0
  32. package/types/util/getPrivacyOptions.d.ts.map +1 -0
  33. package/types/util/sendReplayRequest.d.ts.map +1 -1
  34. package/types/eventBuffer.d.ts +0 -97
  35. 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
- You can manually stop/re-start Replay capture via `.stop()` & `.start()`:
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
- // sometime later
95
- replay.stop();
96
- replay.start();
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 | description |
189
- | ---------------- | ------------------------ | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
190
- | maskAllText | boolean | `true` | Mask _all_ text content. Will pass text content through `maskTextFn` before sending to server. |
191
- | blockAllMedia | boolean | `true` | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`)
192
- | 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 `*`. |
193
- | maskAllInputs | boolean | `true` | Mask values of `<input>` elements. Passes input values through `maskInputFn` before sending to server. |
194
- | maskInputOptions | Record<string, boolean> | `{ password: true }` | Customize which inputs `type` to mask. <br /> Available `<input>` types: `color, date, datetime-local, email, month, number, range, search, tel, text, time, url, week, textarea, select, password`. |
195
- | maskInputFn | (text: string) => string | `(text) => '*'.repeat(text.length)` | Function to customize how form input values are masked before sending to server. By default, masks values with `*`. |
196
- | blockClass | string \| RegExp | `'sentry-block'` | Redact all elements that match the class name. See [privacy](#blocking) section for an example. |
197
- | blockSelector | string | `'[data-sentry-block]'` | Redact all elements that match the DOM selector. See [privacy](#blocking) section for an example. |
198
- | ignoreClass | string \| RegExp | `'sentry-ignore'` | Ignores all events on the matching input field. See [privacy](#ignoring) section for an example. |
199
- | maskTextClass | string \| RegExp | `'sentry-mask'` | Mask all elements that match the class name. See [privacy](#masking) section for an example. |
200
- | maskTextSelector | string | `undefined` | Mask all elements that match the given DOM selector. See [privacy](#masking) section for an example. |
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.