⏱ Estimated Time To Completion: 2 minutes

Options

To mask specific fields, use the mask option, which lets you mask sensitive fields based on CSS selectors. For example, to mask credit card fields:

Sentry.init({
  ...
  integrations: [
    new Sentry.replayIntegration({
      maskAllText: false, 
      maskAllInputs: false,
      mask: 'input[type="creditcard"], .credit-card', // Mask specific fields
    }),
  ],
  ...
});

You can also directly use sentry-mask to mask fields or elements in your code. This provides a simple way to manage privacy without altering your JavaScript configuration.

<input type="text" class="sentry-mask" />

For more details head to https://docs.sentry.io/platforms/javascript/session-replay/privacy/.