user-recorder-sdk
v0.0.1
Published
Lightweight session recording SDK based on rrweb
Maintainers
Readme
user-recorder-sdk
Lightweight session recording SDK based on rrweb.
Installation
npm install user-recorder-sdkOr via CDN:
<script src="https://unpkg.com/user-recorder-sdk/dist/index.iife.js"></script>Usage
ES Modules
import { init, startSession, stopSession } from 'user-recorder-sdk';
// Initialize with your API key
init({
apiKey: 'your-api-key',
// endpoint: 'https://your-api.com/v1', // optional, uses default
debug: false // optional
});
// Start recording
startSession({
identifier: {
type: 'userId', // or 'email', 'anonymous', etc.
value: 'user-123'
},
metadata: {
plan: 'premium' // optional custom metadata
}
});
// Stop recording (call on logout or when done)
stopSession();Script Tag
<script src="https://unpkg.com/user-recorder-sdk/dist/index.iife.js"></script>
<script>
UserRecorder.init({
apiKey: 'your-api-key'
});
UserRecorder.startSession({
identifier: { type: 'userId', value: 'user-123' }
});
</script>Configuration Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| apiKey | string | required | Your API key |
| endpoint | string | https://user-recorder-api-rzzqz.ondigitalocean.app/v1 | API endpoint URL (optional) |
| debug | boolean | false | Enable console logging |
| flushInterval | number | 5000 | How often to send events (ms) |
| maskAllInputs | boolean | false | Mask all input values for privacy |
| options | object | {} | Additional rrweb options |
License
MIT
