Self-hosted, privacy-first web analytics: a browser and server SDK, an API for ingest and reads, and a dashboard, on your own Postgres.
Version 2 is in prerelease. The API runs on api.analytics.remcostoeten.nl and its docs on docs.analytics.remcostoeten.nl. The v2 dashboard is not built yet; v1, which still serves production, lives in v1/.
@spoar/sdktracks pageviews, events, errors and speed from the browser and the server, with React and Next entries and a first-party proxy.@spoar/devtoolsis an overlay panel for admins that shows live visitors, sessions and the event log on their own site.
npm install @spoar/sdk@next
npm install @spoar/devtools@nextbun install
DATABASE_URL=postgres://... bun run setup --owner your-github-login --project my-site --domain example.comThis migrates the database, allows your GitHub login to sign in and creates the first project with its keys. The self-hosting guide covers the environment in apps/api/.env.example, deploying the API and scheduling the jobs.
Requires Bun 1.3.
bun install # install every workspace
bun run test # run all tests
bun run typecheck # typecheck every workspace
bun run dev:v1 # start the v1 dashboardHow the repo is organised and how work is done is in AGENTS.md.
xxx,
Remco Stoeten
MIT