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

@hiveit/browser

v1.1.1

Published

hiveit analytics for the browser: anonymous ids, pageviews, optional click autocapture. Also ships a <script> build.

Readme

@hiveit/browser

hiveit analytics in the browser: an anonymous id kept in localStorage, pageviews across client-side navigation, optional click autocapture, and delivery that survives the page being closed.

import { hiveit } from "@hiveit/browser";

// Point at a proxy route on your own domain, so no key ships to the browser
// and no ad blocker sees a third-party host. See @hiveit/express or @hiveit/next.
const analytics = hiveit({ endpoint: "/api/hiveit/e", autocapture: true });

analytics.track("added_to_cart", { sku: "A-1" });
analytics.identify("user-42", { plan: "pro" }); // merges the anonymous history, once
analytics.reset(); // log out: a fresh anonymous id

hiveit() attaches to the page as soon as it is called. When creation and wiring have to be separate steps (a React render followed by an effect), pass start: false and call analytics.start() yourself; analytics.stop() detaches again and leaves the client usable.

Or without a bundler:

<script src="https://unpkg.com/@hiveit/browser/dist/hiveit.iife.js"
        data-endpoint="/api/hiveit/e" data-autocapture></script>
<script>
  hiveit.track("signup", { plan: "pro" });
</script>

What it sends

Every event carries the current page and campaign context: $current_url and $pathname (query and hash stripped, because those routinely carry tokens), $referrer, $referring_domain, $screen_*, $viewport_*, $locale, $lib, $lib_version, and any utm_*, gclid or fbclid parameters by name. $pageview adds $title.

With autocapture, a click on a link, button, form control or role="button" sends $autocapture_click with the element's tag, visible text, id, classes, href and aria-label. What a user typed is never read: text is taken from textContent only, and skipped entirely for password, email, tel, search, number, date, file and hidden inputs. Add data-hiveit-no-capture to any element to exclude it and everything inside it.

Delivery

Events are batched and retried by @hiveit/core. Unsent events are kept in localStorage (newest 200) so a reload does not lose them, and the queue is flushed on pagehide and when the tab is hidden, using fetch with keepalive so the browser delivers it after the page is gone. Where storage is blocked (private mode, cleared site data) everything still works, it just does not persist.

Calling hiveit() during server rendering is safe: with no window it installs no listeners and tracks nothing, so the same code can run in both places.