SDK

One package, one init call, and the options worth knowing about.

humanbehavior-js records the session and sends batches to ingestion. Almost everything is on by default, so the options below are mostly about turning things off, tightening privacy, or stamping releases.

Entry points

ImportUse for
humanbehavior-jsAny framework. Exports HumanBehaviorTracker.
humanbehavior-js/reactReact apps. HumanBehaviorProvider, useHumanBehavior, useRedaction, useUserTracking, HumanBehaviorErrorBoundary.
import { HumanBehaviorTracker } from "humanbehavior-js";

const tracker = HumanBehaviorTracker.init(apiKey, {
  environment: "production",
  release: "web@2026.8.28",
});

init is idempotent: calling it again returns the tracker that already exists rather than starting a second recorder.

On by default

Session recording, autocaptured clicks and navigation, console capture, network error capture, crash capture, Core Web Vitals, and tracing all run without configuration. Each has an opt-out below.

Options

Identity and connection

OptionDefaultEffect
ingestionUrlour endpointPoint at a reverse proxy you control
logLevel'error''none' | 'error' | 'warn' | 'info' | 'debug'
minimumDurationMilliseconds5000Hold events until the session is this old. 0 sends immediately
maxQueueSize1000Cap on queued events before older ones are dropped

What gets captured

OptionDefaultEffect
enableAutomaticTrackingtrueAutocapture clicks, links, forms, navigation
automaticTrackingOptionstrackButtons, trackLinks, trackForms, includeText, includeClasses
enableConsoleTrackingtrueCapture console.warn / console.error
enableNetworkTrackingtrueCapture failed and slow requests
enableErrorTrackingtrueCapture crashes and unhandled rejections
enableWebVitalstrueFCP, LCP, CLS, INP, TTFB
enableTracingtruePage-load, resource, and custom spans
recordCanvasfalseRecord <canvas> content
enableAutomaticPropertiestrueDetect properties automatically
propertyDenylistProperty names to never send

Errors — see Errors for how these are used.

OptionEffect
ignoreErrorsDrop matching messages client-side (string or RegExp)
denyUrls / allowUrlsDrop, or keep only, errors from matching script URLs
captureThirdPartyResourceErrorsReport cross-origin resource load failures (default false)
captureRequestBodiesAttach redacted request/response bodies to correlated errors (default false)
release, environment, commitSha, distStamped on every error report

Privacy — see Masking and PII.

OptionEffect
redactionStrategy{ mode: 'privacy-first' | 'visibility-first', unredactFields, redactFields }

redactFields at the top level is deprecated

Use redactionStrategy instead. The old flat redactFields option still parses, but it cannot express the visibility-first mode.

Reverse proxy

Setting ingestionUrl to a path on your own domain routes recording through your infrastructure, which keeps requests first-party and survives blockers that reject third-party analytics hosts. Your proxy forwards to our ingestion endpoint unchanged.