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

@varyar/vy-ecom-telemetry

v1.0.0

Published

VarYar telemetry — server fire-and-forget sender, browser scroll/dwell tracker, UA and referrer helpers

Readme

@varyar/vy-ecom-telemetry

VarYar telemetry in two lines — server sender, browser tracker, and UA/referrer helpers.

Install

npm install @varyar/vy-ecom-telemetry

Environment variables

VARYAR_TELEMETRY_URL=https://varyar-ecommerce.vercel.app/api/inbound/telemetry
VARYAR_BUSINESS_UID=VYB-XXXXXXXX
VARYAR_INBOUND_API_KEY=your_inbound_key

Server usage

import { tel } from "@varyar/vy-ecom-telemetry/server";

// Single event — fire and forget, never throws
tel().send({ event_type: "page_view", anon_session_id: sid, page_path: "/shop" });

// Batch
tel().sendBatch([
  { event_type: "product_view", anon_session_id: sid, product_id: "p_123" },
  { event_type: "add_to_cart",  anon_session_id: sid, product_id: "p_123" },
]);

Helpers

import { tel, parseUA, classifyReferrer, resolveSessionId } from "@varyar/vy-ecom-telemetry/server";

// Inside a Remix/React Router loader:
export async function loader({ request }: LoaderFunctionArgs) {
  const sid            = resolveSessionId(request);               // ?sid= or x-session-id header
  const referrer_type  = classifyReferrer(request.headers.get("referer"));
  const { device_type, browser_family, os_family } = parseUA(request.headers.get("user-agent") ?? "");

  tel().send({ event_type: "page_view", anon_session_id: sid, referrer_type, device_type });
}

Class API

import { VyTelemetry } from "@varyar/vy-ecom-telemetry/server";

const myTel = new VyTelemetry({
  url: "https://...",
  businessUid: "VYB-...",
  apiKey: "...",
  timeoutMs: 3000,
});

myTel.send({ event_type: "purchase", anon_session_id: sid });

Client (browser) usage

Import from @varyar/vy-ecom-telemetry/client in your React components. Events are posted to the same-origin /api/telemetry-relay — the API key never leaves the server.

import { initTelemetry } from "@varyar/vy-ecom-telemetry/client";

// In a useEffect or Remix clientLoader:
useEffect(() => {
  const cleanup = initTelemetry({
    sessionId: window.__SESSION_ID__,
    pagePath: window.location.pathname,
    productId: "p_123",   // optional
  });
  return cleanup; // call on unmount / route change
}, []);

initTelemetry automatically fires:

  • session_start on init
  • scroll / scroll_stop as the user scrolls
  • page_view heartbeat every 30 s
  • session_end on tab hide / page unload / cleanup()

One-off events

import { fireEvent } from "@varyar/vy-ecom-telemetry/client";

fireEvent({ event_type: "add_to_cart", anon_session_id: sid, product_id: "p_123" });

Supported event types

page_view · scroll · scroll_stop · element_peek · product_view · product_hover · add_to_cart · remove_from_cart · checkout_start · checkout_abandon · purchase · search · search_click · wishlist_add · session_start · session_end