@piton-/analytics-convex
v1.0.1
Published
A reusable analytics component for Convex.
Readme
Convex Analytics
Production-grade, server-side analytics for Convex: event ingestion, daily rollups, dashboard queries, high-volume batching, and raw event retention — all in your Convex deployment.
Documentation: docs/README.md
Install
npm install @piton-/analytics-convex// convex/convex.config.ts
import { defineApp } from "convex/server";
import analytics from "@piton-/analytics-convex/convex.config.js";
const app = defineApp();
app.use(analytics);
export default app;Run npx convex dev to regenerate the component API, then follow the Quick Start.
What you get
- Server-side event ingestion with idempotency and optional
unique.key - Daily (or hourly) rollup metrics with sharding for high-volume traffic
- Dashboard queries: summaries, comparisons, evaluation labels, funnels, journeys, time series, breakdowns
- Distinct-actor metrics (DAU-style) that stay accurate across multi-day ranges
- Typed
defineAnalytics()setup — one object for tracking, queries, client wrappers, and crons - Retention crons that purge raw events and rollups, and keep up with high write volume
Docs map
| Topic | Guide |
| ----- | ----- |
| First integration | Quick Start |
| Events, metrics, settings | Configuration |
| writeTrack, uniqueness | Tracking |
| Dashboard reads | Querying |
| Multi-tenant filtering | Scopes |
| Limits and scale | Scale and limits |
Development
npm test
npm run buildSee Contributing and Production.
