HumanBehavior SDK provides comprehensive data redaction with two flexible modes to protect sensitive information while maintaining analytics value.Documentation Index
Fetch the complete documentation index at: https://docs.humanbehavior.co/llms.txt
Use this file to discover all available pages before exploring further.
Redaction Modes
Privacy-First Mode (Default)
Everything is masked by default. Selectively unredact fields you want to track.Visibility-First Mode
Everything is visible by default. Selectively redact sensitive fields usingdata-hb-redact="true".
Field Selection Methods
1. Markup-Driven Selection (Primary Method)
Adddata-hb-redact="true" to any input element you want to redact:
2. Programmatic Selection (Privacy-First Only)
For privacy-first mode, configure unredacted fields at initialization:3. Runtime Control
Change redaction settings after initialization:Framework Integration
React/Next.js
Vue
Angular
Vanilla JavaScript
Advanced Features
1:1 Character Masking
Input values are masked with asterisks matching the character count:- Typing “hello” shows ”*****” in recordings
- Typing “test” shows ”****” in recordings
All Input Types Supported
Redaction works with all common input types:text,email,password,number,tel,url,searchtextarea,date,time,datetime-local,month,week
Always Protected
- Password fields: Always masked regardless of mode
- Security: Passwords cannot be unredacted
Common Use Cases
E-commerce Checkout
User Feedback Forms
Simple Markup-Driven Approach
API Reference
| Method | Description |
|---|---|
setUnredactedFields(fields) | Add fields to unredact (privacy-first) |
clearUnredactedFields() | Redact all fields |
hasUnredactedFields() | Check if any fields are unredacted |
getUnredactedFields() | Get currently unredacted fields |
Privacy & Compliance
- Flexible Control: Choose between privacy-first or visibility-first based on your needs
- Automatic Protection: Password fields are always protected
- Real-time Masking: Data is masked as users type
- Compliance Ready: Supports GDPR, HIPAA, and other privacy regulations
- Framework Agnostic: Works consistently across all supported frameworks
Choose the mode that best fits your use case. Privacy-first is recommended for applications handling sensitive data, while visibility-first with
data-hb-redact="true" is better for public-facing applications where you want to track most interactions and only redact specific sensitive fields.