Меню документации

PII Redaction

Documentation is available in English. Перевод в процессе.

BugSpotter automatically detects and masks sensitive text data in the browser before upload. When enabled (default), text fields are sanitized before submission.

Built-in Patterns (9 types)

PatternDetectsExample
emailEmail addressesuser@example.com[REDACTED-EMAIL]
phonePhone numbers+7 701 123-4567[REDACTED-PHONE]
creditcardCredit card numbers4111-1111-1111-1111[REDACTED-CREDITCARD]
ssnUS Social Security123-45-6789[REDACTED-SSN]
iinKazakhstan IIN/BIN860101350478[REDACTED-IIN]
ipIPv4 and IPv6192.168.1.1[REDACTED-IP]
apikeyStripe, AWS, Google keyssk_live_...[REDACTED-APIKEY]
tokenBearer, JWT, OAutheyJhbG...[REDACTED-TOKEN]
passwordPassword field values[REDACTED-PASSWORD]

Presets

Use a preset name instead of listing patterns individually:

PresetPatterns included
allAll 9 patterns
minimalemail, creditcard, ssn
financialcreditcard, ssn
contactemail, phone
identificationssn, iin
credentialsapikey, token, password
kazakhstanemail, phone, iin
gdpremail, phone, ip
pcicreditcard
// Use a preset
await BugSpotter.init({
  sanitize: { patterns: 'kazakhstan' },  // email + phone + IIN
});

// Or pick individual patterns
await BugSpotter.init({
  sanitize: { patterns: ['email', 'phone', 'creditcard'] },
});

Custom Patterns

Add regex patterns for industry-specific data:

await BugSpotter.init({
  sanitize: {
    patterns: 'all',
    customPatterns: [
      {
        name: 'broker-account',
        regex: /FRH\d{9}/gi,
        description: 'Freedom Finance broker account',
      },
      {
        name: 'iban-kz',
        regex: /KZ\d{18}/gi,
        description: 'Kazakhstan IBAN',
      },
      {
        name: 'internal-id',
        regex: /ORD-\d{6,}/gi,
        description: 'Internal order ID',
      },
    ],
    excludeSelectors: ['.public-info'],
  },
});

Custom patterns produce [REDACTED-BROKER-ACCOUNT], [REDACTED-IBAN-KZ], etc.

Visual Element Exclusion

Text sanitization handles console logs, network URLs, and metadata. For visual elements:

  • Session Replay: Use replay.blockSelectors to hide DOM elements from recording
  • Screenshots: Add data-bugspotter-exclude attribute to exclude elements

Performance

PII sanitization adds < 50ms overhead. Patterns are compiled once and reused. Recursive sanitization handles nested objects with circular reference protection.

Next: Self-Hosted Deployment →