humanbehavior-js
Version:
SDK for HumanBehavior session and event recording
40 lines (34 loc) • 1.69 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HumanBehavior Clean Console Demo</title>
</head>
<body>
<h1>HumanBehavior Clean Console Demo</h1>
<p>This demo shows how to suppress common rrweb errors for a clean console.</p>
<!-- External images that would normally cause CORS errors -->
<img src="https://img.lumas.com/showimg_rwt01_search.jpg" alt="External image 1" style="width: 100px; height: 100px;">
<img src="https://media.lumas.de/homepage/2024/magazine-kachel-300x400.webp" alt="External image 2" style="width: 100px; height: 100px;">
<button>Click me to test recording</button>
<input type="text" placeholder="Type something">
<input type="password" placeholder="Password (will be redacted)">
<script src="./dist/index.min.js"></script>
<script>
// Initialize the tracker with error suppression enabled (default)
const tracker = HumanBehaviorTracker.init('13c3e029-ca45-4a3c-a33b-f5dcb297e31c', {
redactFields: ['input[type="password"]'],
suppressConsoleErrors: true, // Enable error suppression (default)
logLevel: 'warn' // Only show warnings and errors
});
console.log('✅ HumanBehavior tracker initialized with clean console mode');
console.log('✅ Canvas security errors and CORS issues will be suppressed');
// Test that core functionality still works
tracker.customEvent('demo_started', {
feature: 'clean_console',
timestamp: Date.now()
});
</script>
</body>
</html>