> ## Documentation Index
> Fetch the complete documentation index at: https://runrehearsals.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Privacy & Compliance

> Protect sensitive user data and comply with privacy regulations

## Overview

Rehearsals provides extensive privacy controls to help you comply with data protection regulations and protect sensitive user information.

<Info>
  Privacy is built into Rehearsals from the ground up. Many protections are enabled automatically without any configuration.
</Info>

## Understanding the Trade-offs

For Rehearsals to deliver the most accurate simulations and projections of your customers, it's important that we can see **email addresses** and **full names** (or receive this information through the [Identity API](/docs/configuration/identity)). This allows us to merge behavioral data with preferential data to create better insights.

If you choose to block this information, you'll need to rely on providing your own preferential data and custom identifiers. If you have questions about this approach, please [contact our support team](https://app.runrehearsals.com/support) to discuss your specific requirements.

## Automatic Privacy Features

Out of the box, Rehearsals automatically:

<Check>**Masks all password fields** - Password inputs are always masked</Check>
<Check>**Respects privacy attributes** - Elements with privacy classes are handled appropriately</Check>
<Check>**Sanitizes sensitive data** - Credit card numbers and similar patterns are automatically detected and masked</Check>

## CSS Class-Based Privacy Controls

Add these classes to any HTML element to control recording behavior:

<ParamField path="dp-block" type="CSS Class">
  Completely blocks the element from recording (appears as placeholder)

  ```html theme={null}
  <div class="dp-block">
    <!-- This entire section will be blocked -->
    <input type="text" name="ssn" />
  </div>
  ```
</ParamField>

<ParamField path="dp-ignore" type="CSS Class">
  Ignores the element entirely (won't appear in recordings at all)

  ```html theme={null}
  <div class="dp-ignore">
    <!-- This won't appear in recordings at all -->
  </div>
  ```
</ParamField>

<ParamField path="dp-mask-text" type="CSS Class">
  Masks all text content within the element

  ```html theme={null}
  <span class="dp-mask-text">
    Sensitive information here <!-- Will appear as ******** -->
  </span>
  ```
</ParamField>

## Common Use Cases

### Masking Personal Information

```html theme={null}
<!-- Phone numbers -->
<input type="tel" class="dp-mask-text" placeholder="Phone" />

<!-- Social Security Numbers -->
<input type="text" class="dp-mask-text" placeholder="SSN" />

<!-- Address -->
<input type="text" class="dp-mask-text" name="street-address" />
```

### Ignoring Irrelevant Content

```html theme={null}
<!-- Chat widget -->
<div id="intercom-widget" class="dp-ignore">
  <!-- Third-party chat widget content -->
</div>

<!-- Admin controls (not visible to regular users) -->
<div class="admin-panel dp-ignore">
  <!-- Admin-only content -->
</div>
```

## Dynamic Privacy Configuration

For advanced users who understand CSS selectors, you can configure privacy settings dynamically through your Rehearsals dashboard. This is useful when you need to block or mask elements based on specific CSS classes or IDs.

### CSS Selector Examples

```css theme={null}
/* Class selectors */
.user-email
.customer-phone
.payment-info

/* ID selectors */
#credit-card-form
#user-profile
#sensitive-data

/* Attribute selectors */
[data-sensitive="true"]
input[name="ssn"]
```

### Configuration Steps

<Steps>
  <Step title="Navigate to Privacy Settings">
    Log into your [Rehearsals Dashboard](https://app.runrehearsals.com), go to Settings, then click on Privacy
  </Step>

  <Step title="Add Custom Selectors">
    Add selectors for blocking or masking specific elements
  </Step>

  <Step title="Test Your Configuration">
    After saving your changes, visit your website and then watch any session replays created after your save to test if things are working as expected
  </Step>
</Steps>

## Legal Compliance Guidelines

If you operate in Europe or California, you will most likely need to:

* Inform users about session recording in your privacy policy
* Obtain consent before recording (especially for EU visitors)
* Allow users to opt-out of recording
* Provide clear information about what data is collected

<Info>
  These are suggestions and guidelines. Please consult with your legal team and follow all applicable local laws and regulations in your jurisdiction.
</Info>

## Support

Have questions about privacy controls or compliance?

<Card title="Contact Support" icon="headset" href="https://app.runrehearsals.com/support">
  Our team is here to help you configure Rehearsals for your privacy needs
</Card>
