---
title: "JavaScript SDK: Privacy controls"
description: "Exclude personal information from captured feedback with the Gleap JavaScript SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/420-javascript-sdk-privacy-controls
collection: "JavaScript"
updated: 2026-11-01
language: en
---

# JavaScript SDK: Privacy controls

Exclude personal information from captured feedback with the Gleap JavaScript SDK. Follow the integration code examples.

## Suppressing personal data

Screenshots and replays can contain what users type into forms. The Gleap SDK masks the values of sensitive fields before they leave the page: every character becomes `*`, so the field keeps its length but not its content. Screenshots and replays follow the same rules.

### Fields masked automatically

These fields are always masked, and replay options cannot turn it off:

-   Password fields (`type="password"`), also after a "show password" button turns them into text fields while replays are recording
    
-   Fields whose `autocomplete` attribute contains `current-password`, `new-password`, `one-time-code`, `cc-number` (card number) or `cc-csc` (card security code)
    

Other values stay readable, because they are often what you need to reproduce a bug. Mask them with the options below.

> **Warning:** Screenshots mask these fields from JavaScript SDK 18.1.1. Earlier versions included the values of password fields in the page snapshot behind a screenshot, even though the rendered image showed dots. Update to 18.1.1 or later.

### Mask a field

Add the class `rr-mask` to a field, or to an element that contains fields, to mask their values:

```html
<input name="secret" type="text" class="rr-mask" />

<form class="rr-mask">
  <input name="iban" type="text" />
  <textarea name="notes"></textarea>
</form>
```

In replays, `rr-mask` also masks the text inside the element. The attribute `gleap-ignore="value"` and the class `gl-mask` mask fields the same way.

> **Note:** Before JavaScript SDK 18.1.1, `rr-mask` masked input values in screenshots only, and only on the field itself. Replays recorded the values of `rr-mask` fields; on those versions only `maskInputOptions` and `maskAllInputs` mask input values in replays.

### Hide an element

Add the class `rr-block` to hide an element and everything inside it:

```html
<div class="test">
  <div class="left">Welcome :)</div>
  <div class="right rr-block">This text is sensitive!</div>
</div>
```

Replays record an empty placeholder of the same size instead of the element. Screenshots render the area blank, and fields inside it are masked.

### Mask every field

To mask the value of every field, call this before initializing Gleap:

```js
Gleap.setReplayOptions({ maskAllInputs: true });
```

This applies to replays and, from JavaScript SDK 18.1.1, to screenshots. Button labels and the state of checkboxes and radio buttons stay visible. To mask only some kinds of fields, use `maskInputOptions`, and to change how masked values look, use `maskInputFn`. Both are described under [Replays](https://gleap-developer-docs.gleap.help/en/articles/399-javascript-sdk-replays#available-options) and apply to screenshots too.

### Class names from older versions

Earlier versions of the Ionic Capacitor documentation used `gl-mask` and `gl-block`. From JavaScript SDK 18.1.1, `gl-mask` masks fields like `rr-mask`; earlier versions did not mask the values of `gl-mask` fields. Screenshots render `gl-block` areas blank, but replays stopped blocking them in JavaScript SDK 16.2.5: use `rr-block` instead.

## Disable default page tracking

Gleap tracks page views by default. If you want to disable this feature, simply add the following method before initializing the Gleap SDK.

```javascript
Gleap.setDisablePageTracking(true);
```

## Filter or disable environment data

To keep fields such as `currentUrl` or `userAgent` out of tickets, or to turn off environment data entirely, see [Environment data](https://gleap-developer-docs.gleap.help/en/articles/410-javascript-sdk-environment-data).

## Related

- [JavaScript SDK setup](https://docs.gleap.ai/en/articles/393-javascript-sdk-setup.md)
- [JavaScript SDK: Code snippet](https://docs.gleap.ai/en/articles/394-javascript-sdk-code-snippet.md)
- [JavaScript SDK: User identity](https://docs.gleap.ai/en/articles/395-javascript-sdk-user-identity.md)
- [JavaScript SDK: Callbacks](https://docs.gleap.ai/en/articles/396-javascript-sdk-callbacks.md)
- [JavaScript SDK: AI chatbar](https://docs.gleap.ai/en/articles/397-javascript-sdk-ai-chatbar.md)
