Skip to content

feat: Add rrweb replay config#255

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
drew/rrweb-replay
Jul 13, 2026
Merged

feat: Add rrweb replay config#255
kodiakhq[bot] merged 2 commits into
mainfrom
drew/rrweb-replay

Conversation

@pulpdrew

@pulpdrew pulpdrew commented May 15, 2026

Copy link
Copy Markdown
Contributor

This PR adds a replay item to the HyperDX config which is passed through to rrweb, allowing for users to pass custom callbacks for DOM mutation events:

    HyperDX.init({
          apiKey,
          service,
          recordCanvas: true,
          replay: {
            hooks: {
              mutation() {
                console.log('DOM mutation observed');
              },
            },
          },
        });
Screen.Recording.2026-05-15.at.2.09.18.PM.mov

Note: canvasMutation is available, but it appears rrweb 1.1.3 does not actually call the canvasMutation callback on all canvas events. A larger upgrade to rrweb v2 may be necessary to improve canvas support.

@changeset-bot

changeset-bot Bot commented May 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: effa6d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hyperdx/browser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pulpdrew pulpdrew force-pushed the drew/rrweb-replay branch from 253a297 to 4fd0551 Compare May 15, 2026 18:14
@pulpdrew

Copy link
Copy Markdown
Contributor Author

Closes #253

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds rrweb replay configuration to the browser SDK. The main changes are:

  • A typed replay option for browser initialization.
  • Replay options forwarded to the session recorder before SDK-managed fields.
  • Documentation for rrweb mutation hooks.
  • A patch changeset for @hyperdx/browser.

Confidence Score: 4/5

The public replay type should stop accepting the recorder-owned emit callback before merging.

  • Hook options are forwarded through the expected recorder path.
  • Explicit browser settings correctly override matching replay fields.
  • replay.emit is accepted by the type but silently replaced at runtime.

packages/browser/src/index.ts

Important Files Changed

Filename Overview
packages/browser/src/index.ts Adds the public replay option and forwards it to the recorder, but exposes an emit callback that the recorder replaces.
packages/browser/README.md Documents replay passthrough, option precedence, and mutation hook usage.
.changeset/angry-ears-share.md Adds a patch changeset for the browser SDK feature.

Fix All in Claude Code Fix All in Conductor Fix All in Cursor Fix All in Codex

Reviews (1): Last reviewed commit: "Merge branch 'main' into drew/rrweb-repl..." | Re-trigger Greptile

type Instrumentations = RumOtelWebConfig['instrumentations'];
type IgnoreUrls = RumOtelWebConfig['ignoreUrls'];

type ReplayConfig = Omit<RumRecorderConfig, 'apiKey' | 'url' | 'debug'>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Recorder Emit Callback Is Ignored

ReplayConfig accepts rrweb's emit option, but SessionRecorder.init replaces it with the SDK's exporter callback after spreading the replay options. A caller can therefore provide replay.emit successfully while the callback is silently never invoked.

Suggested change
type ReplayConfig = Omit<RumRecorderConfig, 'apiKey' | 'url' | 'debug'>;
type ReplayConfig = Omit<
RumRecorderConfig,
'apiKey' | 'url' | 'debug' | 'emit'
>;

Context Used: AGENTS.md (source)

Fix in Claude Code Fix in Conductor Fix in Cursor Fix in Codex

@kodiakhq kodiakhq Bot merged commit 9de609b into main Jul 13, 2026
8 checks passed
@kodiakhq kodiakhq Bot deleted the drew/rrweb-replay branch July 13, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants