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

@hanzo/observe

v0.1.1

Published

Hanzo Observe — default-on interaction capture for React. Watches every click/input/nav/visibility across the tree, annotates each with a semantic hierarchy (component path / role / data-testid / aria) auto-derived from the DOM, and emits it through @hanz

Readme

@hanzo/observe

Default-on interaction capture for React, on top of @hanzo/event.

Mount one provider and every click, input, navigation, and (opt-in) visibility is captured — each one annotated with a semantic hierarchy auto-derived from the tree (component path / role / data-testid / accessible name) — and emitted through @hanzo/event to the ONE front door (POST /v1/event). Privacy-gated (input redaction) and fail-soft by default. A live event-stream hook powers session playback.

'use client'
import { AnalyticsProvider } from '@hanzo/event/react'
import { ObserveProvider } from '@hanzo/observe/react'

export function Root({ children }) {
  return (
    <AnalyticsProvider config={{ product: 'console' }}>
      <ObserveProvider>{children}</ObserveProvider>
    </AnalyticsProvider>
  )
}

That is the whole setup. Every interaction now arrives on the pipe as a reserved autocapture event ($click, $input, $change, $submit, $pageview, $view) with properties like:

{
  "$el": "Dashboard/UserCard/button[save]",   // the significant-node trail
  "$role": "button",
  "$testid": "save",
  "$component": "SaveButton",
  "$path": ["Dashboard", "UserCard", "button[save]"]
}

The semantic hierarchy

For the element an interaction lands on, the engine walks the DOM ancestry and describes each step as a SemanticNodetag, ARIA role (explicit or implicit), testid, accessible name, and component. The result is a small JSON-LD document (@context, @type: "Interaction", path, target, label) carried with the event. So a click is not "a click at (x, y)" but "a click on the Save button, inside UserCard, inside the Dashboard navigation."

Component names come from a data-hz-name / data-component attribute (stable in production) when present, else from the nearest named React fiber owner (available in development builds).

Privacy

Privacy-first by default:

  • Input values are withheld. An $input/$change event carries the field's kind and value length, never the typed text.
  • Sensitive fields are always redacted (password / email / card / cvv / token / ssn / …) — not even a length.
  • data-hz-private (or data-observe="off" / data-private) on an element or any ancestor excludes the whole subtree from capture.

To capture non-sensitive text values (e.g. a search box), pass redaction={{ maskInput: false }} — sensitive fields stay redacted regardless.

Session playback

import { useEventStream } from '@hanzo/observe/react'

function Timeline() {
  const { events, clear } = useEventStream({ limit: 200 })
  return <ol>{events.map((e, i) => <li key={i}>{e.name} → {e.semantic.label}</li>)}</ol>
}

useEventStream subscribes to the same stream the engine feeds; it is a rolling, in-memory window for building a live session-playback UI.

Framework-agnostic core

The . entry has no React or transport dependency — it is the engine, the annotator, the redactor, and the stream:

import { observe } from '@hanzo/observe'

const engine = observe((i) => analytics.capture(i.name, { el: i.semantic.label }))
engine.stream.subscribe(render) // live playback
engine.stop()

This is what the Svelte (@hanzo/observe-svelte) and native (@hanzo/observe-native) adaptors build on.

Note on build-time component names

Reliable component names in production want a build step that stamps data-hz-name onto rendered elements (the runtime already reads it). That is a JSX/AST codemod — separate tooling from this runtime SDK — and is a documented follow-on, not part of this package.

License

BSD-3-Clause © Hanzo AI