![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
rrweb
Advanced tools
Package description
rrweb is a library for recording and replaying user interactions on web applications. It captures user events such as clicks, scrolls, and form inputs, and allows you to replay these events to understand user behavior or debug issues.
Recording User Interactions
This feature allows you to record user interactions on a web page. The `record` function starts recording and emits events that can be sent to a server or saved locally.
const rrweb = require('rrweb');
const stopFn = rrweb.record({
emit(event) {
// send event to your server or save it locally
console.log(event);
},
});
// To stop recording
stopFn();
Replaying Recorded Sessions
This feature allows you to replay recorded sessions. The `rrwebPlayer` takes the recorded events and replays them in a specified container element.
const rrwebPlayer = require('rrweb-player');
new rrwebPlayer({
target: document.body, // the container element
data: {
events: [], // the array of recorded events
},
});
Custom Event Handling
This feature allows you to handle custom events during the recording. You can filter and process specific types of events as needed.
const rrweb = require('rrweb');
const stopFn = rrweb.record({
emit(event) {
if (event.type === 'custom') {
// handle custom event
console.log('Custom event:', event);
}
},
});
// To stop recording
stopFn();
FullStory is a digital experience analytics platform that captures and analyzes user interactions on web and mobile applications. It provides similar functionalities to rrweb but includes advanced analytics and insights.
Hotjar is a behavior analytics and user feedback service that helps you understand how users interact with your website. It offers features like heatmaps, session recordings, and surveys, similar to rrweb but with additional user feedback tools.
Mouseflow is a session replay and heatmap tool that tracks user interactions on your website. It provides functionalities similar to rrweb, including session recordings and heatmaps, but also offers funnel analysis and form analytics.
Readme
rrweb 是 'record and replay the web' 的简写,旨在利用现代浏览器所提供的强大 API 录制并回放任意 web 界面中的用户操作。
目前 rrweb 已经解决了许多录制与回放中的难点问题,但在 1.0 版本 release 之前数据结构仍有可能发生变化,请谨慎用于生产环境中。
rrweb 主要由 3 部分组成:
为了保证录制和回放时可以对应到一致的数据结构,rrweb 采用 typescript 开发以提供更强的类型支持。
npm install
安装所需依赖除了添加集成测试和单元测试之外,rrweb 还提供了交互式的测试工具。
运行 npm run repl
,将会启动浏览器并在命令行要求输入一个测试的 url:
Enter the url you want to record, e.g https://react-redux.realworld.io:
输入后等待浏览器打开指定页面,并在命令行中出现以下提示信息:
Enter the url you want to record, e.g https://react-redux.realworld.io: https://github.com
Going to open https://github.com...
Ready to record. You can do any interaction on the page.
Once you want to finish the recording, enter 'y' to start replay:
此时可以在页面中进行交互,待所需录制操作完成后,在命令行输入 y,测试工具就会将刚刚的操作进行回放,用于验证录制是否成功。
回放时命令行中将出现以下提示信息:
Enter 'y' to persistently store these recorded events:
此时可以再次在命令行中输入 y,测试工具将把已录制的内容存入一个静态 HTML 文件中,并提示存放位置:
Saved at PATH_TO_YOUR_REPO/temp/replay_2018_11_23T07_53_30.html
该文件默认使用最新 bundle 的 rrweb 代码,所以我们可以在修改代码后运行 npm run bundle:browser
,之后刷新静态文件就可以查看最新代码对回放的影响并进行调试。
FAQs
record and replay the web
The npm package rrweb receives a total of 300,663 weekly downloads. As such, rrweb popularity was classified as popular.
We found that rrweb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.