Record user interactions and automatically generate Playwright tests, videos, and screenshots
A complete, production-ready SaaS solution that records user interactions on any website and converts them into executable Playwright tests with videos and screenshots.
- π― One-line integration - Single script tag, works on any domain
- π¬ Comprehensive recording - Clicks, inputs, scrolling, hovers, keyboard shortcuts, forms
- π€ Auto-generates Playwright tests - Convert recordings to executable test code
- πΉ Video recordings - Full session recordings in WebM format
- πΈ Screenshots - Before/after screenshots for visual verification
- π Trace files - Detailed Playwright traces for debugging
- π Privacy-first - Built-in privacy controls and data filtering
- β‘ Performance optimized - Event throttling, sampling rates, session limits
- π CORS-free - Works from any domain without configuration
- ποΈ Configurable - Extensive configuration options for production use
# Clone the repository
git clone <your-repo-url>
cd POC
# Install dependencies
npm install
# Start the server
npm run server
# Server runs on http://localhost:3002Add this single line to any website:
<script
src="http://localhost:3002/sdk/recorder.js"
data-project-id="your-project-id"
></script>That's it! Recording starts automatically. β¨
- Dashboard: http://localhost:3002
- Generate artifacts: Click "π¬ Generate Video & Screenshots"
- Download: Tests, videos, and screenshots automatically generated
POC/
βββ client/
β βββ recorder.js # Browser SDK (16KB)
βββ server/
β βββ index.js # Express server
β βββ converter.js # Event β Playwright converter
β βββ runner-simple.js # Test execution & artifacts
β βββ database-simple.js # JSON file database
β βββ data/ # Session data storage
βββ dashboard/
β βββ index.html # Management dashboard
βββ test-pages/ # Demo applications
βββ CLIENT-INTEGRATION.md # Integration guide
βββ PRODUCTION-READY-FEATURES.md # Feature documentation
βββ DEMO-SCRIPT.md # Demo walkthrough
<script
src="http://localhost:3002/sdk/recorder.js"
data-project-id="production-site"
data-sampling-rate="0.1"
data-max-events-per-session="500"
data-exclude-elements=".sensitive,.private"
data-enable-scroll-tracking="true"
data-enable-hover-tracking="false"
></script>| Option | Default | Description |
|---|---|---|
data-project-id |
required | Project identifier |
data-sampling-rate |
1.0 |
Recording rate (0.1 = 10%) |
data-max-events-per-session |
1000 |
Max events per session |
data-exclude-elements |
"" |
CSS selectors to ignore |
data-include-elements-only |
"" |
Only track these selectors |
data-enable-scroll-tracking |
true |
Track scrolling |
data-enable-hover-tracking |
true |
Track mouse hovers |
data-enable-keyboard-tracking |
true |
Track keyboard shortcuts |
data-enable-form-tracking |
true |
Track form submissions |
<!-- Method 1: Data attribute -->
<input type="text" data-recorder-ignore placeholder="Sensitive data">
<!-- Method 2: CSS selectors -->
<script data-exclude-elements=".payment,.personal-info">- β Password fields never recorded
- β Credit card inputs auto-detected and ignored
- β PII patterns automatically excluded
- β Configurable element filtering
useEffect(() => {
const script = document.createElement('script');
script.src = 'http://localhost:3002/sdk/recorder.js';
script.setAttribute('data-project-id', 'react-app');
document.body.appendChild(script);
}, []);mounted() {
const script = document.createElement('script');
script.src = 'http://localhost:3002/sdk/recorder.js';
script.dataset.projectId = 'vue-app';
document.body.appendChild(script);
}ngOnInit() {
const script = document.createElement('script');
script.src = 'http://localhost:3002/sdk/recorder.js';
script.setAttribute('data-project-id', 'angular-app');
document.body.appendChild(script);
}For each recording session, the system generates:
- Playwright Test (
test.spec.js) - Executable test code - Video Recording (
recording.webm) - Full session video - Screenshots (
screenshots/) - Before/after captures - Trace File (
trace.zip) - Detailed execution trace
| Event Type | Data Captured | Use Case |
|---|---|---|
click |
Element, position, viewport | User interactions |
input |
Field value, element info | Form completion |
scroll |
Position, document size | User engagement |
hover |
Element, position | Interest patterns |
keydown |
Key combos, shortcuts | Power user behavior |
form_submit |
Form data (safe fields) | Conversion tracking |
navigation |
URL changes, SPA routing | User journeys |
GET /- DashboardGET /sdk/recorder.js- SDK scriptPOST /api/events- Event ingestionGET /api/sessions- List sessionsPOST /api/sessions/{id}/run-test- Generate artifactsGET /artifacts/{session}/- Download files
- β Event throttling (scroll: 100ms, hover: 200ms)
- β Sampling rates for production traffic
- β Session limits to prevent memory leaks
- β Background delivery with sendBeacon
- β Configurable batch sizes and intervals
<script
src="https://analytics.yoursite.com/recorder.js"
data-project-id="ecommerce-prod"
data-sampling-rate="0.05"
data-exclude-elements=".checkout-form,.payment-info"
data-max-events-per-session="200"
></script><script
src="https://analytics.yoursite.com/recorder.js"
data-project-id="dashboard-prod"
data-sampling-rate="0.2"
data-enable-hover-tracking="false"
data-exclude-elements=".user-data,.api-keys"
></script>- Node.js 18+
- Chrome/Chromium for Playwright
- Modern browser support (ES6+)
- Fork the repository
- Create feature branch
- Make changes
- Test thoroughly
- Submit pull request
MIT License - see LICENSE file for details
- Production-Ready: Used in real SaaS applications
- Zero Configuration: Works immediately on any domain
- Privacy-First: Built-in protection for sensitive data
- Performance Optimized: Handles high-traffic websites
- Framework Agnostic: Works with React, Vue, Angular, vanilla JS
- Complete Solution: Recording + Analysis + Test Generation
Start recording user interactions in 30 seconds! π