Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@rrweb/types
Advanced tools
This package contains the shared types used across rrweb packages. See the [guide](../../guide.md) for more info on rrweb.
@rrweb/types is a TypeScript type definition package for rrweb, a library for recording and replaying user interactions on web pages. This package provides type definitions for various events and data structures used in rrweb, making it easier to work with rrweb in TypeScript projects.
Event Types
Defines the structure of an event with time, which includes the type of event, data associated with the event, timestamp, and delay.
import { eventWithTime } from '@rrweb/types';
const event: eventWithTime = {
type: 1,
data: {},
timestamp: Date.now(),
delay: 0
};
Incremental Snapshot Event
Defines the structure of an incremental snapshot event, which includes the type of event, data related to the snapshot, timestamp, and delay.
import { incrementalSnapshotEvent } from '@rrweb/types';
const snapshotEvent: incrementalSnapshotEvent = {
type: 2,
data: {
source: 1,
positions: [{ x: 0, y: 0, id: 1 }]
},
timestamp: Date.now(),
delay: 0
};
Full Snapshot Event
Defines the structure of a full snapshot event, which includes the type of event, data related to the full snapshot, timestamp, and delay.
import { fullSnapshotEvent } from '@rrweb/types';
const fullSnapshot: fullSnapshotEvent = {
type: 3,
data: {
node: {
id: 1,
type: 1,
childNodes: []
}
},
timestamp: Date.now(),
delay: 0
};
TypeScript is a superset of JavaScript that adds static types. While it doesn't provide specific types for rrweb, it allows you to define your own types and interfaces, offering flexibility and type safety in your projects.
io-ts is a runtime type system for IO decoding/encoding in TypeScript. It allows you to define types and validate data at runtime, which can be useful for ensuring the correctness of data structures similar to those used in rrweb.
Zod is a TypeScript-first schema declaration and validation library. It provides a way to define and validate data structures, similar to the type definitions provided by @rrweb/types, but with additional runtime validation capabilities.
This package contains the shared types used across rrweb packages. See the guide for more info on rrweb.
Become a sponsor and get your logo on our README on Github with a link to your site.
Yuyz0112 |
Yun Feng |
eoghanmurray |
Juice10 open for rrweb consulting |
FAQs
This package contains the shared types used across rrweb packages. See the [guide](../../guide.md) for more info on rrweb.
We found that @rrweb/types demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.