rrweb
rrweb copied to clipboard
How to use the Plugin Canvas WebRTC Record correctly?
Can anyone provide guidance into how to use the Plugin Canvas Web correctly? I also have rrweb working correctly, so that it sends all the information it collects to a Golang server that dumps the information into a SQLite database. But I want to test out the Plugin for Canvas record, however the examples provided in the Readme file of the Plugin seems to be very specific in sending the data straight to Replay.
This is what I have so far: `
let events = [];
// Initialize the plugin correctly const canvasWebRTCPlugin = rrwebPluginCanvasWebRTCRecord();
// Start recording let stopRecording = rrweb.record({ emit(event) { events.push(event); }, plugins: [canvasWebRTCPlugin], // Register the plugin recordCanvas: false, // Enable canvas recording checkoutEveryNth: 200, // Optional: helps segment recordings });
// Function to send recorded events to backend function save() { const body = JSON.stringify({ events }); events = []; fetch('/rrwcapture', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body, }); }
// Save every 5 seconds setInterval(save, 5000); `
Anyone have the correct way of using this plugin?