From a44589a519e2cf42885314491dff41c57da0e0cd Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Fri, 19 May 2023 14:17:40 -0700 Subject: [PATCH 1/2] fix(replays): Show the correct Replay config option name `maskFn` --- packages/replay/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/replay/README.md b/packages/replay/README.md index a790370c2d49..091f51d785bf 100644 --- a/packages/replay/README.md +++ b/packages/replay/README.md @@ -195,17 +195,17 @@ The following options can be configured as options to the integration, in `new R The following options can be configured as options to the integration, in `new Replay({})`: -| key | type | default | description | -| ---------------- | ------------------------ | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| maskAllText | boolean | `true` | Mask _all_ text content. Will pass text content through `maskTextFn` before sending to server. | -| maskAllInputs | boolean | `true` | Mask values of `` elements. Passes input values through `maskInputFn` before sending to server. | -| blockAllMedia | boolean | `true` | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`) -| 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 `*`. | -| block | Array | `.sentry-block, [data-sentry-block]` | Redact any elements that match the DOM selectors. See [privacy](#blocking) section for an example. | -| unblock | Array | `.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. | -| mask | Array | `.sentry-mask, [data-sentry-mask]` | Mask all elements that match the given DOM selectors. See [privacy](#masking) section for an example. | -| unmask | Array | `.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. | -| ignore | Array | `.sentry-ignore, [data-sentry-ignore]` | Ignores all events on the matching input fields. See [privacy](#ignoring) section for an example. | +| key | type | default | description | +| ---------------- | ------------------------ | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| maskAllText | boolean | `true` | Mask _all_ text content. Will pass text content through `maskFn` before sending to server. | +| maskAllInputs | boolean | `true` | Mask values of `` elements. Passes input values through `maskInputFn` before sending to server. | +| blockAllMedia | boolean | `true` | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`) | +| maskFn | (text: string) => string | `(text) => '*'.repeat(text.length)` | Function to customize how text content is masked before sending to server. By default, masks text with `*`. | +| block | Array | `.sentry-block, [data-sentry-block]` | Redact any elements that match the DOM selectors. See [privacy](#blocking) section for an example. | +| unblock | Array | `.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. | +| mask | Array | `.sentry-mask, [data-sentry-mask]` | Mask all elements that match the given DOM selectors. See [privacy](#masking) section for an example. | +| unmask | Array | `.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. | +| ignore | Array | `.sentry-ignore, [data-sentry-ignore]` | Ignores all events on the matching input fields. See [privacy](#ignoring) section for an example. | #### Deprecated options In order to streamline our privacy options, the following have been deprecated in favor for the respective options above. From 0354135157bf31e383ae9a5a9650db2b11c65011 Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Fri, 19 May 2023 14:21:33 -0700 Subject: [PATCH 2/2] Fix the type, because `recordOptions` is falling back to Record<>! --- packages/replay/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/replay/src/types.ts b/packages/replay/src/types.ts index 12900dc22e74..9f8402bb71e0 100644 --- a/packages/replay/src/types.ts +++ b/packages/replay/src/types.ts @@ -330,7 +330,7 @@ export interface ReplayIntegrationPrivacyOptions { /** * A callback function to customize how your text is masked. */ - maskFn?: Pick; + maskFn?: (s: string) => string; } // These are optional for ReplayPluginOptions because the plugin sets default values