Product
A journey recorder that stops at the shape of a visit
next-story records where a visitor went, where they clicked in frustration, where a click did nothing, and how the session ended. It stores that in your own Postgres and hands it to control-plane agents through three read-only endpoints.
- 01
Four event types, closed
page_view, rage_click, dead_click and conversion. The list is fixed in the SDK and in the database enum. JS errors, API failures and Web Vitals are out of scope.
- 02
One row per session
A worker closes a session after 30 minutes without events and writes one summary: entry and exit route, route path, duration, rage and dead click counts, outcome.
- 03
Three questions an agent can ask
Sessions, daily rollups and period-over-period comparison, each behind its own scope and bound to the sites a token may read. No SQL passthrough.
- 04
Many sites, one install
Every event, token and query carries a site id. The site id is derived from the verified token on the server, never accepted from the browser.
What you install and run
Every part lives in one repository and runs on infrastructure you control.
- SDK
- @next-story/journey-recorder (client, server, shared entrypoints)
- Collector
- A Next.js Route Handler, Edge or Node runtime
- Storage
- Postgres through an EventSink you implement (Drizzle helper)
- Jobs
- session-close, daily-rollup and retention (apps/worker)
- Agent API
- Hono app with three GET endpoints (apps/agent-api)
- License
- MIT
- Status
- Pre-1.0 (v0.1.1); the API may change
What it deliberately does not do
No session replay: no DOM snapshots, no video, no page content. Dead-click detection asks a MutationObserver one yes-or-no question and records a latency number, never what changed.
No identity system. The default resolver mints a first-party anonymous id cookie; linking it to your own user id is a port your app implements.
No conversion rule engine. A conversion is an explicit track call or one route pattern per site, nothing else.
No hosted service. You run the collector, the database, the jobs and the agent API.
See the path an event takes
From the click in the browser to the row an agent reads.