|
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();
|
90 | 90 | 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.
|
|
0 commit comments