@maple-dev/browser
v0.1.0
Published
Maple browser SDK — OpenTelemetry tracing and rrweb session replay in one package. Every span and replay event shares a session id for trace↔replay correlation.
Maintainers
Readme
@maple-dev/browser
Browser SDK for Maple — OpenTelemetry tracing and rrweb
session replay in a single package. Every span and every replay event is tagged
with the same session.id, so a trace can link straight to the replay that
produced it (and vice versa) with no clock-skew guessing.
Install
npm install @maple-dev/browserUsage
import { MapleBrowser } from "@maple-dev/browser"
MapleBrowser.init({
ingestKey: "maple_pk_...", // public ingest key
serviceName: "acme-web",
environment: "production",
replay: { enabled: true, sampleRate: 1.0 },
privacy: { maskAllInputs: true },
})That single call:
- starts OTel browser tracing, auto-instrumenting
fetch, exporting to Maple's ingest (POST /v1/traces); - records the session with rrweb, chunking events (~5s / 100KB windows),
gzipping them with the native
CompressionStream, and uploading toPOST /v1/sessionReplays/blob; - writes session metadata at start (
active) and on page hide (ended), including the trace ids observed during the session.
Privacy
maskAllInputs (default on) masks every <input> value. Use rrweb's
attribute hooks (data-rr-block, .rr-block, .rr-ignore) to block elements
or subtrees from capture.
Notes
- Replay event blobs live in object storage; only small, queryable metadata is indexed — playback streams blobs directly via signed URLs.
- The SDK is best-effort: network failures in telemetry never throw into your app.
