@tracelog/lib 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/dist/browser/tracelog.esm.js +671 -640
- package/dist/browser/tracelog.esm.js.map +1 -1
- package/dist/browser/tracelog.js +2 -2
- package/dist/browser/tracelog.js.map +1 -1
- package/dist/cjs/constants/config.constants.d.ts +1 -0
- package/dist/cjs/constants/config.constants.d.ts.map +1 -1
- package/dist/cjs/constants/config.constants.js +19 -2
- package/dist/cjs/constants/config.constants.js.map +1 -1
- package/dist/cjs/handlers/click.handler.d.ts +2 -0
- package/dist/cjs/handlers/click.handler.d.ts.map +1 -1
- package/dist/cjs/handlers/click.handler.js +27 -5
- package/dist/cjs/handlers/click.handler.js.map +1 -1
- package/dist/cjs/utils/network/url.utils.d.ts +2 -1
- package/dist/cjs/utils/network/url.utils.d.ts.map +1 -1
- package/dist/cjs/utils/network/url.utils.js +6 -2
- package/dist/cjs/utils/network/url.utils.js.map +1 -1
- package/dist/esm/constants/config.constants.d.ts +1 -0
- package/dist/esm/constants/config.constants.d.ts.map +1 -1
- package/dist/esm/constants/config.constants.js +17 -0
- package/dist/esm/constants/config.constants.js.map +1 -1
- package/dist/esm/handlers/click.handler.d.ts +2 -0
- package/dist/esm/handlers/click.handler.d.ts.map +1 -1
- package/dist/esm/handlers/click.handler.js +28 -6
- package/dist/esm/handlers/click.handler.js.map +1 -1
- package/dist/esm/utils/network/url.utils.d.ts +2 -1
- package/dist/esm/utils/network/url.utils.d.ts.map +1 -1
- package/dist/esm/utils/network/url.utils.js +6 -2
- package/dist/esm/utils/network/url.utils.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -449,6 +449,52 @@ npm run test:unit # Unit tests
|
|
|
449
449
|
npm run test:e2e # E2E tests
|
|
450
450
|
```
|
|
451
451
|
|
|
452
|
+
## Security & Privacy
|
|
453
|
+
|
|
454
|
+
TraceLog is designed with **privacy-first** principles. Key security guarantees:
|
|
455
|
+
|
|
456
|
+
### ✅ What We Protect
|
|
457
|
+
|
|
458
|
+
- **Input Value Protection**: NEVER captures values from `<input>`, `<textarea>`, or `<select>` elements
|
|
459
|
+
- **PII Sanitization**: Automatically redacts emails, phone numbers, credit cards, and API keys from error messages and click text
|
|
460
|
+
- **Default URL Filtering**: Removes sensitive query parameters (`token`, `auth`, `key`, `session`, `password`, `api_key`, `secret`, etc.)
|
|
461
|
+
- **Client-Side Controls**: All validation, sampling, and deduplication happen in the browser
|
|
462
|
+
- **XSS Protection**: All metadata is sanitized against common XSS patterns
|
|
463
|
+
|
|
464
|
+
### 🛡️ Tools for You
|
|
465
|
+
|
|
466
|
+
- **`data-tlog-ignore` Attribute**: Exclude sensitive UI elements from tracking
|
|
467
|
+
```html
|
|
468
|
+
<!-- Payment form - completely ignored -->
|
|
469
|
+
<div data-tlog-ignore>
|
|
470
|
+
<input type="text" name="card_number">
|
|
471
|
+
<button>Pay Now</button>
|
|
472
|
+
</div>
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
- **Custom URL Parameters**: Extend default filtering with your own sensitive params
|
|
476
|
+
```typescript
|
|
477
|
+
await tracelog.init({
|
|
478
|
+
sensitiveQueryParams: ['affiliate_id', 'promo_code'] // Merged with defaults
|
|
479
|
+
});
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
- **Conditional Sampling**: Adjust tracking based on user consent level
|
|
483
|
+
```typescript
|
|
484
|
+
const samplingRate = userConsent === 'full' ? 1.0 : 0.1;
|
|
485
|
+
await tracelog.init({ samplingRate });
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### 📋 Your Responsibilities
|
|
489
|
+
|
|
490
|
+
- **GDPR Consent**: Initialize TraceLog ONLY after user consent, call `destroy()` on revoke
|
|
491
|
+
- **Custom Event Data**: Sanitize PII before sending via `tracelog.event()`
|
|
492
|
+
- **Sensitive Elements**: Mark admin/payment UI with `data-tlog-ignore`
|
|
493
|
+
|
|
494
|
+
**📚 Read the full security guide:** [SECURITY.md](./SECURITY.md)
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
452
498
|
## License
|
|
453
499
|
|
|
454
500
|
MIT © TraceLog. See [LICENSE](LICENSE) file for details.
|