Skip to content

[ CONVEX COMPONENT · STABLE · MIT ]

@vllnt/convex-analytics

Generic, configurable analytics component for Convex — any event, any dimension, any domain; rollup-on-write with funnels, retention, uniques

STABLE 0.1.0 · 2 GitHub stars

Package details

Install

The untagged install gets the latest stable version (0.1.0). The canary tag tracks main (0.1.1-canary.46dc78e).

terminal
pnpm add @vllnt/convex-analytics
pnpm add @vllnt/convex-analytics@canary

Register the component

Add it to your app’s convex/convex.config.ts, then run npx convex dev to generate the references.

convex/convex.config.ts
import { defineApp } from "convex/server";
import analytics from "@vllnt/convex-analytics/convex.config";
const app = defineApp();
app.use(analytics);
export default app;

Use it

Usage, options and examples are in the package README.

Read the README

Downloads

Last 7 days
51
Since first publish
7,887

Downloads per week since 15 June 2026, oldest on the left. Weeks count back from 23 November 2026, so the first one may be shorter than seven days.

51 downloads in the last 7 days. 7,887 downloads since 15 June 2026. Source: npm, counted through 23 November 2026.

Show downloads per week as a table
WeekDownloads
15 June 2026409
16 June 2026 to 22 June 2026352
23 June 2026 to 29 June 2026612
30 June 2026 to 6 July 2026465
7 July 2026 to 13 July 2026171
14 July 2026 to 20 July 2026265
21 July 2026 to 27 July 202629
28 July 2026 to 3 August 202629
4 August 2026 to 10 August 2026379
11 August 2026 to 17 August 2026232
18 August 2026 to 24 August 202628
25 August 2026 to 31 August 2026582
1 September 2026 to 7 September 2026673
8 September 2026 to 14 September 20261,617
15 September 2026 to 21 September 2026586
22 September 2026 to 28 September 2026430
29 September 2026 to 5 October 2026168
6 October 2026 to 12 October 202643
13 October 2026 to 19 October 202663
20 October 2026 to 26 October 202688
27 October 2026 to 2 November 2026328
3 November 2026 to 9 November 2026224
10 November 2026 to 16 November 202663
17 November 2026 to 23 November 202651

Release history

Every release on a timeline, oldest on the left. A tall mark with its version is a stable release; a short mark is a canary build. The time axis is the one of the downloads chart, so a release stands above the week it shipped in.

1 stable release and 10 canary builds since 15 June 2026. Latest stable: 0.1.0 on 1 September 2026.

Show every release as a table
VersionKindPublished
0.1.1-canary.46dc78ecanary31 October 2026
0.1.0stable1 September 2026
0.1.0-canary.a5028f9canary1 September 2026
0.1.0-canary.2b9f918canary31 August 2026
0.1.0-canary.67f5cc1canary31 August 2026
0.1.0-canary.e99d8e6canary16 June 2026
0.1.0-canary.55667b0canary16 June 2026
0.1.0-canary.332b387canary15 June 2026
0.1.0-canary.a68a60ccanary15 June 2026
0.1.0-canary.531be7ccanary15 June 2026
0.1.0-canary.e8e8f2bcanary15 June 2026

Changelog

The newest stable releases of @vllnt/convex-analytics, with the notes from its changelog.

  1. 0.1.0

    First stable release (the earlier 0.1.0-canary.* builds were published from June 2026). The component is a generic, domain-neutral analytics core — the earlier web-locked draft was replaced before any public release, so the generic rebuild is folded into this single 0.1.0 entry.

    Added
    • Generic core — free-string event name, opaque subjectRef / sessionRef, host-typed scalar props (no v.any()), and host-declared dimensions. Zero hardcoded domain.
    • Rollup-on-write — counts are incremented as events land, so metric / top / timeseries read in O(1) (backed by @convex-dev/aggregate + @convex-dev/sharded-counter).
    • Verb set — track, metric, top, timeseries, uniques, funnel, retention, distribution, list, configure; all generic across any event / dimension / domain.
    • Distribution — distribution(name, measure, { buckets }) is a histogram over a numeric props measure (declared upper-bound bins + overflow, with count / sum), computed from raw events in range (index-backed, bounded).
    • Granularities — minute / hour / day rollup buckets (minute opt-in for short live windows), end-to-end through track, the read verbs, and the REST routes.
    • Config surface — scope, dimensions, granularities, retentionDays, sampleRate, sessionIdleMs, propsValidator; sensible defaults, zero config required. Config is applied (not ignored) — dimensions / granularities / sampleRate per call, retention / sampling / idle persisted for the crons via configure.
    • Opaque scope partition on every table, mutation, and query for multi-tenant isolation.
    • Per-session rate limiting, dedupe, and sampling built into track.
    • Schema — five sandboxed tables (events, rollups, subjects, sessions, config); raw events TTL-pruned, rollups kept forever.
    • Crons — daily prune (raw-event TTL) and closeSessions (idle close), idempotent; plus a backfill mutation to re-derive rollups.
    • Web preset — opt-in @vllnt/convex-analytics/web: webDimensions, parseUserAgent, geoFromHeaders, trackPageview. The generic core carries no web fields.
    • React hooks — optional @vllnt/convex-analytics/react: useMetric, useTop, useTimeseries, useUniques over the host's re-exported aggregate query refs.
    • REST API — five generic x-api-key-authed routes (/track, /metric, /top, /timeseries, /uniques), timing-safe key comparison.
    • Testing — @vllnt/convex-analytics/test export for convex-test, registering the child components so track is exercised end-to-end.
    Fixed (since the first canary)
    • Register automatic session-closing and event-retention cron jobs, including zero-config scopes.
    • Seek expired events by (scope, ts), page scope discovery, and bound/reschedule maintenance at 500 rows per transaction.
    • Preserve valid rollups when backfill input exceeds its supported 50,000-event bound instead of deleting them and silently rebuilding from truncated input.
    • Count funnel subjects through later valid repeated steps, isolate rate limits and counters with collision-safe tuple keys, and reopen sessions without moving lastTs backward.
    Changed (since the first canary)
    • Treat Convex _generated output as CLI-owned, exclude it from formatting, and expose a dedicated codegen script.
    • Adopt the stable v2 vllnt toolchain, TypeScript 7 validation, Convex 1.45, convex-test 0.0.56, and the latest compatible direct dependencies.
    • Use explicit table names for Convex database patch/delete operations.
All releases of @vllnt/convex-analytics
Stable releases
RSSAtomJSON Feed
Canary builds
RSSAtomJSON Feed

Licence

Released under the MIT licence. The full text is in the source repository.

[ PACKAGE ]

Stable
0.1.0
Canary
0.1.1-canary.46dc78e
GitHub stars
2 GitHub stars
Licence
MIT

Theme