How to use rrweb - 1 common examples

To help you get started, we’ve selected a few rrweb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LuckyWinty / UserBehaviorRecord / record-repo / src / record.js View on Github external
const userRecord = ()=>{
        let events = [];

        const stopFn = rrweb.record({
          emit(event) {
            // 将 event 存入 events 数组中
            if(event.length > 100){
                // 当事件数量大于 100 时停止录制
              stopFn();
            }
            events.push(event);
          },
        });
        
        // save 函数用于将 events 发送至后端存入,并重置 events 数组
        function save() {
          const body = JSON.stringify({ events });
          events = [];
          axios.post('http://localhost:3333/user/addBehavior',{
            username:'lucky winty',msg:'test testApi',data:body

rrweb

record and replay the web

MIT
Latest version published 2 years ago

Package Health Score

82 / 100
Full package analysis

Popular rrweb functions