Configuration
Basic Configuration
Section titled “Basic Configuration”import { WriteTrack } from 'writetrack';
const tracker = new WriteTrack('#my-input', { minSamples: 20, // Minimum keystrokes before analysis sensitivity: 'medium', // 'low', 'medium', 'high' captureClipboard: true // Track paste events});Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
minSamples | number | 20 | Minimum keystrokes needed for reliable analysis |
sensitivity | string | ’medium’ | Detection sensitivity level |
captureClipboard | boolean | true | Whether to track paste events |
captureCorrections | boolean | true | Track backspace/delete patterns |
Sensitivity Levels
Section titled “Sensitivity Levels”- low — Only flag obvious paste patterns (fewer false positives)
- medium — Balanced detection (recommended)
- high — Aggressive detection (may have more false positives)
Events
Section titled “Events”tracker.on('paste', (event) => { console.log('Paste detected:', event.length, 'characters');});
tracker.on('analyze', (result) => { console.log('Analysis complete:', result);});