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

trackkit

v0.1.0

Published

Privacy-first, provider-agnostic analytics SDK with consent management, SSR support, and typed events

Readme

Trackkit Core SDK

Privacy-first analytics facade for modern web apps.

Trackkit provides a single, typed API for sending analytics events to:

  • Umami
  • Plausible
  • GA4 (Measurement Protocol only — no gtag.js)
  • Custom providers

It requires no remote scripts, supports SSR hydration, consent gating, queue-first delivery, and CSP-friendly transports.

View the full documentation site here.

Install

npm install trackkit
# or
pnpm add trackkit
# or
yarn add trackkit

~18kb core (minified + brotli). Adapters are tree-shakeable — only the one you use is bundled.

Usage

Trackkit exposes a small facade API with both instance and singleton usage styles.

import { createAnalytics } from 'trackkit';

const analytics = createAnalytics({
  provider: { name: 'umami', site: 'your-site-id' },
});

analytics.pageview();
analytics.track('signup_submitted', { plan: 'starter' });

For full documentation, see the Quickstart, detailed guides, API reference, and example applications on the Trackkit docs site.

TypeScript niceties

Define an event map and pass it as a type parameter to createAnalytics for compile-time checking of track() calls:

import { createAnalytics } from 'trackkit';

type MyEvents = {
  signup_submitted: { plan: 'free' | 'pro' };
  purchase_completed: { amount: number; currency: string };
};

const analytics = createAnalytics<MyEvents>({
  provider: { name: 'umami', site: '...' },
});

analytics.track('signup_submitted', { plan: 'pro' });     // ✅ compiles
analytics.track('signup_submitted', { plan: 'gold' });     // ❌ type error
analytics.track('signup_submited');                         // ❌ typo caught

When no type parameter is supplied, behaviour is unchanged — any event name and any props are accepted.

Note: The singleton API (init / track) does not support typed events. Use the factory API (createAnalytics<E>()) for compile-time event checking.

SSR

Trackkit ships a dedicated SSR entry:

import { ssrPageview } from 'trackkit/ssr';

export function render() {
  ssrPageview('/home');
}

SSR events are serialised into the page and hydrated into the client runtime queue exactly once.

See the full SSR documentation for complete guidance.

Built-in Provider specifics

  • Umami: cookieless; self-host friendly (host required when not using cloud). identify() is implemented as a no-op for compatibility with the facade.
  • Plausible: cookieless; goals & revenue support.
  • GA4: consent-sensitive; supports identify via user_id; optional apiSecret for Measurement Protocol.

All providers follow Trackkit’s gating rules (PolicyGate → Consent → Provider readiness). Provider-specific behaviour applies after that.

See the Provider Guides for complete details.

Migrating from existing tracking snippets

Trackkit provides comprehensive migration guides for:

License

MIT © Enkosi Ventures