{"_id":"@browser-replay/plugin-canvas-webrtc-record","_rev":"2-0740e68c0a99bb06b269979eae686e87","name":"@browser-replay/plugin-canvas-webrtc-record","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@browser-replay/plugin-canvas-webrtc-record","version":"0.0.1","keywords":["browser-replay"],"author":{"name":"browser-replay maintainers"},"license":"MIT","_id":"@browser-replay/plugin-canvas-webrtc-record@0.0.1","maintainers":[{"name":"stradum","email":"vcatalano@gmail.com"}],"homepage":"https://github.com/browser-replay/browser-replay/tree/master/packages/plugins/plugin-canvas-webrtc-record#readme","bugs":{"url":"https://github.com/browser-replay/browser-replay/issues"},"dist":{"shasum":"7377386bf0db7843508402ccc34b9c292b0167f5","tarball":"https://registry.npmjs.org/@browser-replay/plugin-canvas-webrtc-record/-/plugin-canvas-webrtc-record-0.0.1.tgz","fileCount":9,"integrity":"sha512-qIhwXwv4BDqc0D49Qptw7If+AULR141MU2XhiGrn7wdNgVBvGITGz5GXvTwgnC2fq8eQShAjx89fTN0NN+6Mmw==","signatures":[{"sig":"MEUCIBO1a7ti5tT9OFimy2G+lJ0XWTEZSNW738Hx6ckOHaqaAiEAqNbxUDIzzBQSvAryjTvud/JEvP7xOhXwTDpRA1IAvQo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47391},"main":"./dist/index.cjs","type":"module","_from":"file:browser-replay-plugin-canvas-webrtc-record-0.0.1.tgz","types":"./dist/index.d.cts","module":"./dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"scripts":{"dev":"tsdown --watch","build":"pnpm run prepublish","prepublish":"tsc -noEmit && tsdown","check-types":"tsc -noEmit --pretty"},"_npmUser":{"name":"stradum","email":"vcatalano@gmail.com"},"_resolved":"/tmp/474251d378f39548124c9e9b5fa7c92e/browser-replay-plugin-canvas-webrtc-record-0.0.1.tgz","_integrity":"sha512-qIhwXwv4BDqc0D49Qptw7If+AULR141MU2XhiGrn7wdNgVBvGITGz5GXvTwgnC2fq8eQShAjx89fTN0NN+6Mmw==","repository":{"url":"git+https://github.com/browser-replay/browser-replay.git","type":"git","directory":"packages/plugins/plugin-canvas-webrtc-record"},"_npmVersion":"10.9.4","description":"browser-replay plugin to record canvas via WebRTC","directories":{},"sideEffects":false,"_nodeVersion":"22.21.0","dependencies":{"simple-peer-light":"^9.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.16","typescript":"6.0.3","vite-plugin-dts":"^5.0.2","@browser-replay/core":"0.0.1","@browser-replay/types":"0.0.1"},"peerDependencies":{"@browser-replay/core":"^0.0.1","@browser-replay/types":"^0.0.1"},"_npmOperationalInternal":{"tmp":"tmp/plugin-canvas-webrtc-record_0.0.1_1781019749886_0.9912394764447952","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@browser-replay/plugin-canvas-webrtc-record","version":"0.0.2","description":"browser-replay plugin to record canvas via WebRTC","type":"module","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.cts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"keywords":["browser-replay"],"license":"MIT","devDependencies":{"typescript":"6.0.3","vite":"^8.0.16","vite-plugin-dts":"^5.0.2","@browser-replay/core":"0.0.2","@browser-replay/types":"0.0.2"},"peerDependencies":{"@browser-replay/core":"^0.0.2","@browser-replay/types":"^0.0.2"},"dependencies":{"simple-peer-light":"^9.10.0"},"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"author":{"name":"browser-replay maintainers"},"sideEffects":false,"engines":{"node":">=20"},"repository":{"type":"git","url":"git+https://github.com/browser-replay/browser-replay.git","directory":"packages/plugins/plugin-canvas-webrtc-record"},"bugs":{"url":"https://github.com/browser-replay/browser-replay/issues"},"homepage":"https://github.com/browser-replay/browser-replay/tree/master/packages/plugins/plugin-canvas-webrtc-record#readme","scripts":{"dev":"tsdown --watch","build":"pnpm run prepublish","check-types":"tsc -noEmit --pretty","prepublish":"tsc -noEmit && tsdown"},"_id":"@browser-replay/plugin-canvas-webrtc-record@0.0.2","_integrity":"sha512-0U0TdyVbesqg+09H1s+HPpVq+/8ocYPlhiqGuHGbUrEJnwgWI2elRh19MhtaxTmDj8AQQLaOKel7nZH7DSlSGw==","_resolved":"/tmp/6c5c173d5861c17721c60e3e091e0379/browser-replay-plugin-canvas-webrtc-record-0.0.2.tgz","_from":"file:browser-replay-plugin-canvas-webrtc-record-0.0.2.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-0U0TdyVbesqg+09H1s+HPpVq+/8ocYPlhiqGuHGbUrEJnwgWI2elRh19MhtaxTmDj8AQQLaOKel7nZH7DSlSGw==","shasum":"22b08e6e9d837522c063b74240adddcbbde9163a","tarball":"https://registry.npmjs.org/@browser-replay/plugin-canvas-webrtc-record/-/plugin-canvas-webrtc-record-0.0.2.tgz","fileCount":9,"unpackedSize":47391,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC90g4UvpgO05XJr3EBuIINPFaLJICxN2tEk6TnrdnuYwIhAKfaYJmzz+qNT3Qb/1yynMYoi83KTKP2JAoZpsnLYaAI"}]},"_npmUser":{"name":"stradum","email":"vcatalano@gmail.com"},"directories":{},"maintainers":[{"name":"stradum","email":"vcatalano@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-canvas-webrtc-record_0.0.2_1781723758102_0.582025300844742"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-09T15:42:29.657Z","modified":"2026-06-17T19:15:58.387Z","0.0.1":"2026-06-09T15:42:30.052Z","0.0.2":"2026-06-17T19:15:58.251Z"},"bugs":{"url":"https://github.com/browser-replay/browser-replay/issues"},"author":{"name":"browser-replay maintainers"},"license":"MIT","homepage":"https://github.com/browser-replay/browser-replay/tree/master/packages/plugins/plugin-canvas-webrtc-record#readme","keywords":["browser-replay"],"repository":{"type":"git","url":"git+https://github.com/browser-replay/browser-replay.git","directory":"packages/plugins/plugin-canvas-webrtc-record"},"description":"browser-replay plugin to record canvas via WebRTC","maintainers":[{"name":"stradum","email":"vcatalano@gmail.com"}],"readme":"# browser-replay canvas webrtc plugin\n\nPlugin that live streams contents of canvas elements via webrtc\n\n## Example of live streaming via `pnpm live-stream`\n\nhttps://user-images.githubusercontent.com/4106/186701616-fd71a107-5d53-423c-ba09-0395a3a0252f.mov\n\n## Instructions\n\n### Record side\n\n```js\n// Record side\n\nimport { record } from '@browser-replay/record';\nimport { RRWebPluginCanvasWebRTCRecord } from '@browser-replay/plugin-canvas-webrtc-record';\n\nconst webRTCRecordPlugin = new RRWebPluginCanvasWebRTCRecord({\n  signalSendCallback: (msg) => {\n    // provides webrtc sdp offer signal & connect message\n    // make sure you send this to the replayer's `webRTCReplayPlugin.signalReceive(signal)`\n    sendSignalToReplayer(msg); // example of function that sends the signal to the replayer\n  },\n});\n\nrecord({\n  emit: (event) => {\n    // send these events to the `replayer.addEvent(event)`, how you do that is up to you\n    // you can send them to a server for example which can then send them to the replayer\n    sendEventToReplayer(event); // example of function that sends the event to the replayer\n  },\n  plugins: [\n    // add the plugin to the list of plugins, and initialize it via `.initPlugin()`\n    webRTCRecordPlugin.initPlugin(),\n  ],\n  recordCanvas: false, // we don't want canvas recording turned on, we're going to do that via the plugin\n});\n```\n\n### Replay Side\n\n```js\n// Replay side\nimport { Replayer } from '@browser-replay/replay';\nimport { RRWebPluginCanvasWebRTCReplay } from '@browser-replay/plugin-canvas-webrtc-replay';\n\nconst webRTCReplayPlugin = new RRWebPluginCanvasWebRTCReplay({\n  canvasFoundCallback(canvas, context) {\n    console.log('canvas', canvas);\n    // send the canvas id to `webRTCRecordPlugin.setupStream(id)`, how you do that is up to you\n    // you can send them to a server for example which can then send them to the replayer\n    sendCanvasIdToRecordScript(context.id); // example of function that sends the id to the record script\n  },\n  signalSendCallback(signal) {\n    // provides webrtc sdp offer signal & connect message\n    // make sure you send this to the record script's `webRTCRecordPlugin.signalReceive(signal)`\n    sendSignalToRecordScript(signal); // example of function that sends the signal to the record script\n  },\n});\n\nconst replayer = new Replayer([], {\n  UNSAFE_replayCanvas: true, // turn canvas replay on!\n  liveMode: true, // live mode is needed to stream events to the replayer\n  plugins: [webRTCReplayPlugin.initPlugin()],\n});\nreplayer.startLive(); // start the replayer in live mode\n\nreplayer.addEvent(event); // call this whenever an event is received from the record script\n```\n\n## More info\n\nhttps://github.com/browser-replay/browser-replay (canvas WebRTC streaming)\n","readmeFilename":"README.md"}