Introduction
:::caution Pre-release This is a pre-1.0 library (v0.1.1) — API may change without notice. Feedback on the design is welcome; see the GitHub issues. :::
@next-story/journey-recorder is a privacy-first JavaScript SDK for recording user interactions in Next.js applications. It captures structured behavioral events (page views, clicks, and conversions) at the Edge, with no raw URLs, no raw IPs, and no session replay.
What this is
- A lightweight client-side SDK that batches user interaction events
- A same-origin HTTPS route handler that collects and validates those events at the Edge
- Structured event data (not video, not DOM replay)
- MIT-licensed, open-source, free
- Privacy-by-design: URLs normalized to patterns, IPs hashed with daily-rotating salt, raw events partition-dropped for retention
What this is NOT
- Not session replay. No DOM reconstruction, no video, no keystroke logging.
- Not JS error tracking. Uncaught exceptions, runtime errors, and network failures are out of scope.
- Not analytics in the traditional sense. No click heatmaps, no scroll depth, no arbitrary custom events — only the four types the SDK recognizes.
Five-minute integration
npm install @next-story/journey-recorder
# or
pnpm add @next-story/journey-recorder
- Middleware — mint a secure token for the client.
- Collect route — accept and validate event batches.
- Client init — start recording in the browser.
See the Quickstart for a complete walkthrough.
Open source
- Repository: github.com/catesandrew/next-story
- License: MIT
- Package: @next-story/journey-recorder on npm