Introduction
Capture analytics in your app and POST batches to your own endpoint.
Call init() to start autocapture. Landscape sends event batches to the URL you set as endpoint. You store and query the data yourself.
Install and capture
import { init } from "@hyperreal/landscape-core";
init({ endpoint: "/api/events" });
init() starts clicks, forms, page views, outbound links, downloads, scroll, and rage-click capture in the browser. Call track() for custom events. See Getting Started.
Packages
| Task | Package |
|---|---|
| Browser capture | @hyperreal/landscape-core |
| React, React Router, Next.js | @hyperreal/landscape-react |
Custom track() |
@hyperreal/landscape-core (track) |
Typed track() |
@hyperreal/landscape-plugins-manual-tracking/typed (createTypedTrack) |
| Typed event contracts | @hyperreal/landscape-schema or @hyperreal/landscape-schema/zod |
| Node / edge emit | @hyperreal/landscape-server |
| Web Vitals / unhandled errors | @hyperreal/landscape-plugins-web-vitals, @hyperreal/landscape-plugins-error-tracking |
Defaults
| Setting | Default |
|---|---|
| Autocapture | all categories on |
autocapture.pageViews |
true in core init(); false under LandscapeProvider |
defaultConsent |
true |
collectMetadata |
all collectors on |
batchSize |
10 |
flushIntervalMs |
5000 |
track() |
core verb; not required for autocapture |
Constraints
- No PII collection, fingerprinting, or cross-site tracking.
$-prefixed names are reserved for built-in events.- Public verbs never throw into the host app. Pass
onErrorto observe failures. @hyperreal/landscape-serveremits events. It does not receive browser batches.
Receive batches on Ingesting Events. Configure capture on Autocapture.