auto_capture
controls what your SDK collects automatically (clicks, inputs, text, etc.) and how sensitive data is masked or excluded.
Quick start
If you don’t want to override a field, simply omit it. Using undefined
in JavaScript is equivalent to “not set”.
Options
Key | Type | Default | Description | Example |
---|---|---|---|---|
enabled | boolean | true * | Master switch for automatic capture. When false , no auto capture runs (manual tracking still works). | true |
excluded_elements | string[] (CSS selectors) | [] | Do not track events originating from elements matching any selector. Useful for admin areas, iframes, or components you don’t want logged. | [".no-track", "#private-area"] |
masked_elements | string[] (CSS selectors) | [] | Mask text/values from these elements before sending (replaced with *** ). Ideal for passwords, emails, phone numbers, or custom fields. | [".pii"] |
excluded_attributes | string[] (attribute names) | [] | Strip these attributes from outgoing payloads across all elements (e.g., internal IDs, secrets). | ["data-secret","data-internal"] |
Selector tips
- Prefer scoped attributes for stability over brittle class names:
- Exclude:
[data-up-ignore="true"]
- Mask:
[data-up-mask]
- Exclude:
- To exclude an entire component tree, target the container:
#billing-widget, .chatbot-shell
- To mask all inputs except a whitelist, combine selectors:
input:not([data-up-allow])
Examples
Disable auto capture entirely
Exclude a component and mask specific fields
Strip sensitive attributes globally
Best practices
- Attribute contracts: Use
data-up-*
attributes in your app code so rules survive refactors and CSS changes. - Review regularly: Audit
excluded_elements
andmasked_elements
during major UI releases.
Type definition (optional)
Troubleshooting
- “My rule doesn’t apply” – Verify the selector matches the actual rendered DOM, not framework component names.
- “PII still appears” – Add both a mask rule for the element and an exclude attribute rule if PII is in attributes.
- Performance – Prefer fewer, broader selectors (e.g., container IDs) over many granular ones.