npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@devalxui/kova-analytics

v1.0.0

Published

Zero-config privacy-first analytics with real-time dashboard. No database required. Auto-tracks pageviews, clicks, scroll depth, forms, custom events. Works with any framework.

Readme

kova-analytics

Zero-config, privacy-first analytics with a real-time dashboard. No database required. No cookies. GDPR compliant.

Drop it in, add one line of code, get a full analytics dashboard at /kova-analytics.

Features

  • Zero config — works out of the box with file-based storage
  • Real-time dashboard — live visitors, pageviews, events, all updating live
  • Auto-tracking — pageviews, clicks, scroll depth, form submissions, UTM params
  • Custom eventskova.track("signup", { plan: "pro" })
  • SPA support — tracks pushState/replaceState navigation
  • No cookies — uses sessionStorage + localStorage only
  • Privacy first — respects Do Not Track, no third-party requests
  • Lightweight script — ~3KB tracking snippet
  • Geo detection — country/city from IP (optional)
  • Password protected — dashboard requires authentication
  • Customizable theme — dark, light, or custom colors
  • API access — query your analytics programmatically
  • Multiple storage backends — file (default), memory, PostgreSQL, or custom
  • Works everywhere — Next.js, Express, Hono, Bun, Deno, plain Node

Quick Start

Next.js (App Router)

npm install @devalxui/kova-analytics
// app/kova-analytics/[[...path]]/route.ts
import { withKovaAnalytics } from "@devalxui/kova-analytics/next";

const { handler } = withKovaAnalytics({
  password: "your-secret-password",
});

export const GET = handler;
export const POST = handler;
// app/layout.tsx
import { KovaAnalytics } from "@devalxui/kova-analytics/react";

export default function Layout({ children }) {
  return (
    <html>
      <body>
        {children}
        <KovaAnalytics endpoint="/kova-analytics" />
      </body>
    </html>
  );
}

Done. Visit /kova-analytics to see your dashboard.

Express

import express from "express";
import { kovaAnalytics } from "@devalxui/kova-analytics/express";

const app = express();

app.use(kovaAnalytics({
  password: "your-secret-password",
}));

app.listen(3000);

Any framework (Hono, Bun, Deno)

import { createHandler } from "@devalxui/kova-analytics";

const handler = createHandler({
  password: "your-secret-password",
});

// Use with any framework that supports Request/Response

Script tag (no framework)

<script src="https://yoursite.com/kova-analytics/script.js"></script>

Custom Events

// Track anything
kova.track("signup", { plan: "pro", source: "landing" });
kova.track("purchase", { product: "hoodie", price: 59.99 });
kova.track("video_play", { title: "Demo Video" });

Configuration

withKovaAnalytics({
  // Storage
  storage: "file",              // "file" | "memory" | "postgres" | "custom"
  filePath: "./analytics.json", // file storage path
  postgresUrl: "postgres://...",// for postgres storage

  // Dashboard
  dashboardPath: "/kova-analytics", // dashboard URL
  password: "secret",           // dashboard password
  username: "admin",            // dashboard username

  // Tracking
  trackClicks: true,            // auto-track clicks
  trackScrollDepth: true,       // auto-track scroll depth
  trackForms: true,             // auto-track form interactions

  // Geo
  enableGeo: true,              // IP-based country/city detection

  // Real-time
  liveTimeout: 30,              // seconds before visitor considered gone

  // Theme
  theme: "dark",                // "dark" | "light" | "custom"
  accentColor: "#f5f0e8",      // accent color
  backgroundColor: "#0a0a0a",  // background color

  // API
  enableApi: true,              // enable /stats and /live API endpoints
  apiKey: "your-api-key",       // optional API key
});

API Endpoints

When enableApi is true:

GET  /kova-analytics/stats?period=7d    # Dashboard stats
GET  /kova-analytics/live               # Live visitors
POST /kova-analytics/track              # Ingest tracking data
GET  /kova-analytics/script.js          # Tracking script

Auth: Authorization: Bearer {password} header or ?token={password} query param.

Dashboard

The dashboard shows:

  • Live visitors — real-time with path, device, country
  • Pageviews timeline — hourly or daily chart
  • Top pages — most visited pages
  • Top referrers — where traffic comes from
  • Devices — desktop / mobile / tablet breakdown
  • Browsers & OS — Chrome, Firefox, Safari, etc.
  • Countries — visitor geography
  • UTM campaigns — source, medium, campaign tracking
  • Custom events — your tracked events ranked
  • Scroll depth — how far visitors scroll
  • Form analytics — submissions vs abandons

Storage Backends

File (default)

No setup needed. Stores everything in ./kova-analytics.json.

Memory

For serverless or testing. Data resets on restart.

PostgreSQL

withKovaAnalytics({
  storage: "postgres",
  postgresUrl: "postgres://user:pass@host:5432/db",
});

Tables are auto-created on first use.

Custom

withKovaAnalytics({
  storage: "custom",
  customStorage: myCustomAdapter, // implements StorageAdapter interface
});

License

MIT