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

@classytic/analytics

v0.2.0

Published

Framework-agnostic web + server analytics. One typed track() fans out to GA4, Meta Pixel/Conversions API, TikTok and GTM; browser↔server event_id dedup, consent gating. Commerce taxonomy (view_item…purchase) and a React provider ship as tree-shakeable sub

Downloads

44

Readme

@classytic/analytics

Framework-agnostic web + server analytics. One typed track() fans out to GA4, Meta Pixel/Conversions API, TikTok and GTM — with browser↔server event_id deduplication and per-purpose consent gating. Zero runtime dependencies.

The commerce event taxonomy (view_itempurchase) and a React provider ship as tree-shakeable subpaths, so a non-commerce app pays for neither.

Subpaths

| Import | What | |---|---| | @classytic/analytics | core: createAnalytics, ConsentStore, browser adapter factories | | @classytic/analytics/commerce | GA4-shaped ecommerce constructors + minor→major money mappers | | @classytic/analytics/react | <AnalyticsProvider>, useTrack, usePageViews, useTrackOnce, useConsent | | @classytic/analytics/server | Meta CAPI / GA4 MP / TikTok Events-API body builders + hashUserData |

Platform layout

src/platforms/
├── google/   ga4.ts (browser)          · measurement-protocol.ts (server)
├── meta/     pixel.ts (browser)        · capi.ts (server)     · events.ts (translation)
├── tiktok/   pixel.ts (browser)        · events-api.ts (server) · events.ts
└── gtm/      index.ts (dataLayer)

One directory per platform; browser + server twins + the name/param translation table live together, so adding a channel is a self-contained folder.

React quick start

import { AnalyticsProvider } from '@classytic/analytics/react';

<AnalyticsProvider config={{
  google: { measurementId: 'G-XXXX' },
  meta: { pixelId: '1234567890' },
}}>
  {children}
</AnalyticsProvider>
import { useTrack, useTrackOnce } from '@classytic/analytics/react';
import { addToCart, purchase } from '@classytic/analytics/commerce';

// product page
const track = useTrack();
track(addToCart({ lines: [{ id: sku, name, unitPriceMinor: price }], currency: 'BDT' }));

// success page — idempotent across refresh / StrictMode
useTrackOnce(orderId, () => purchase({
  transactionId: orderId, lines, currency: 'BDT', totalMinor: total,
}));

Money

Callers pass integer minor units (paisa/cents) everywhere — the same convention as the rest of the platform. Conversion to the major units pixels expect happens exactly once, at this boundary (toMajor, default exponent 2).

Dedup

track() returns the resolved event with its eventId. Forward that id to the server twin (Meta CAPI event_id, GA4 MP params.event_id) so the platform collapses browser + server into one conversion instead of double-counting.