Bardrr is a node.js package for recording browser events for the Bard session replay and analysis tool.
This is a Node.js package available through the npm registry. Installation is done using the npm install command:
$ npm install bardrr
In order to use the bardrr Agent to collect browser events, you must import the Agent from bardrr. Then in your app, you need to call the start
method on an instance of the Agent, passing in an object with an appName
, endpoint
and MAX_IDLE_TIME
.
appName
is the name of the application you're recording.endpoint
is where the Agent will send the events.MAX_IDLE_TIME
is the amount of idle time (in milliseconds) after which a session ends. Example:
import Agent from "bardrr";
new Agent().start({
appName: "Better Brew",
endpoint: "http://www.betterbrew.com",
MAX_IDLE_TIME: 60 * 1000,
});
Custom events allow Bard users to create queryable events from very specific user actions on their site. To trigger a custom event, you need to import the Agent and call the static handleCustomEvent
method on it with a string as an argument. This string is the custom event's type, and is used to query the custom event in the Bard user interface.
import Agent from "bardrr";
Agent.handleCustomEvent("myCustomEvent");
Additional configuration is available through the recordOptions
and recordConsolePlugin
properties of the object exported by config.js
, which are preset to reasonable defaults. Detailed documentation for recordOptions
and recordConsolePlugin
is available on the rrweb GitHub page, specifically here and here, respectively.
You can read more about our project here.