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

@byline/analytics-agent

v5.0.0

Published

Tiny dependency-free browser collector for Byline analytics

Readme

@byline/analytics-agent

The dependency-free browser collector for @byline/analytics. It sends one cookieless first-party page event on load, accepts committed SPA navigation locations from a host adapter, and observes download clicks without delaying navigation. The package mounts no route and injects no script by itself.

Install the package, place its minified dist/b.js artifact in the static directory served by the application, and load it with ordinary HTML:

npm install @byline/analytics-agent
cp node_modules/@byline/analytics-agent/dist/b.js public/b.js
<script
  defer
  src="/b.js"
  data-endpoint="/telemetry/events"
  data-ignore-prefixes="/admin,/_byline"
></script>

data-endpoint is required and must be a same-origin, root-relative path. The package needs no framework, route helper, or build integration.

The application's static host owns the script's MIME, cache, and security headers. It must serve the file as JavaScript; a stable filename should use a bounded cache lifetime with revalidation. Host integrations may offer a dynamic-response helper when the application wants those headers supplied in code instead.

The published package also exports the standalone artifact as @byline/analytics-agent/standalone.js, a programmatic browser API, and a bundle-safe source string:

import { ANALYTICS_AGENT_SOURCE } from '@byline/analytics-agent/source'

An application chooses its public filename and ingest route. Host adapters can provide optional delivery and component helpers, but those helpers do not make their paths part of the analytics package contract.

Applications that bundle the browser API can install and stop it directly:

import { installAnalyticsAgent } from '@byline/analytics-agent'

const agent = installAnalyticsAgent({ endpoint: '/telemetry/events' })
agent.stop()

The agent never writes client storage. It only reads localStorage["byline-analytics-ignore"], the explicit per-browser opt-out. It does not inspect or transmit Global Privacy Control: Byline analytics neither sells nor shares the installation's data, and GPC is not a general first-party processing opt-out.

Host adapters must feed only committed/resolved navigations by dispatching byline:analytics:navigate with the resolved location string as the custom event detail. Preloads and hover activity must never dispatch that event. Consent owners can stop the standalone collector by dispatching byline:analytics:stop; the TanStack AnalyticsAgent helper does this when it unmounts.