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

trackhome-react

v2.3.1

Published

Embeddable trackhome analytics dashboard for React — just pass authKey + uid.

Readme

trackhome-react

Embeddable trackhome analytics dashboard for React. Pass two props, get a live dashboard.

Tree-shakeable: pick your entry

Since v1.3.0 the package ships three entry points. Pick the one that matches your use case and the bundler drops everything else from your production bundle.

| Import path | Bundle (min) | What you get | |--------------------------|--------------|-----------------------------------------------------------------------| | trackhome-react/readonly | ~42 KB | View-only dashboard. No editor code at all. | | trackhome-react/editable | ~104 KB | Full in-browser editor (add / edit / drag / resize / AI agent / etc.) | | trackhome-react | ~104 KB | Alias for /editable. Kept so existing imports keep working. |

readonly is a strict subset of editable. If you render dashboards that are configured elsewhere (admin UI, server-side, etc.) and never need to edit them in the host page, import /readonly and you'll save ~60 KB minified.

v2.0.0 dropped the dedicated index.tsx barrel — the bare trackhome-react entry is now wired straight to /editable so existing imports keep compiling without a separate shim file. New code should pick /readonly or /editable explicitly. See "v2.0.0 migration" below.

Install

npm install trackhome-react

Quick start — read-only (recommended for production embeds)

import { TrackhomeDashboardView } from 'trackhome-react/readonly';

function App() {
  return (
    <TrackhomeDashboardView
      endpoint="YOUR_TRACKHOME_URL"
      authKey="ek_abc123..."
      uid="my-dashboard"
    />
  );
}

The component fetches its config (widgets, name, theme) from the server, renders the widgets, and refreshes on a timer. No editor UI is loaded — there is no way for a viewer to mutate the dashboard.

Quick start — editable (in-browser customization)

import { TrackhomeDashboard } from 'trackhome-react/editable';

function App() {
  return (
    <TrackhomeDashboard
      endpoint="YOUR_TRACKHOME_URL"
      authKey="ek_abc123..."
      uid="my-dashboard"
      editable                 // enables Edit / Add widget / drag / resize
      secretKey="..."          // admin SECRET_KEY — required to save edits
    />
  );
}

The editable component supports everything the readonly one does, plus:

  • "+ Add widget" / "✎ Edit" / drag-to-reorder / resize / duplicate / remove
  • Tab CRUD (add / rename / delete / reorder)
  • Widget editor modal with three modes:
    • AI — natural-language prompt → spec
    • Visual — form editor for sources / measures / formulas / view
    • JSON — raw spec textarea
  • Live preview (debounced) against the server
  • Snapshot history modal (view + restore within 30-day TTL)

All mutations PATCH /e/<authKey>/<uid> and require the admin secretKey.

v2.0.0 migration (breaking)

v2.0.0 dropped the bare trackhome-react entry. Update imports to be explicit:

- import { TrackhomeDashboard } from 'trackhome-react';
+ import { TrackhomeDashboard } from 'trackhome-react/editable';

If you only render dashboards (no in-browser editing), prefer the smaller readonly bundle:

- import { TrackhomeDashboard } from 'trackhome-react';
+ import { TrackhomeDashboardView } from 'trackhome-react/readonly';

The . entry still resolves (it points at /editable) so existing code that imports from 'trackhome-react' continues to compile and bundle — but the barrel file is gone. New code should pick a subpath explicitly.

Props

TrackhomeDashboardView (readonly)

| Prop | Type | Required | Description | |---|---|---|---| | endpoint | string | Yes | Base URL of your trackhome instance | | authKey | string | Yes | Read-only embed key (NOT your secret key) | | uid | string | Yes | Unique dashboard identifier | | secretKey | string | No | Admin secret — only used to enrich per-widget filter autocomplete | | refreshInterval | number | No | Auto-refresh interval in seconds. Default: 30. Set 0 to disable. | | dateRange | { from?, to? } | No | Custom date range (YYYY-MM-DD). Defaults to last 7 days. Hides the UI picker when set. | | className | string | No | CSS class for the container |

TrackhomeDashboard (editable) adds

| Prop | Type | Required | Description | |---|---|---|---| | editable | boolean | No | Enable in-browser edit mode. Default: false. | | secretKey | string | No* | Admin SECRET_KEY. Required to save edits. If omitted and editable is true, the user is prompted on first Edit click (cached in localStorage). |

* Effectively required when editable is true — without it, every save returns 401.

Getting an authKey

  1. Open your trackhome admin dashboard
  2. Go to EmbedsNew key
  3. Create an embed dashboard (clone from existing or configure from scratch)
  4. Copy the generated authKey + uid

The authKey is read-only — it can only read dashboard configs and aggregate analytics. It cannot access raw events, links, funnels, or admin operations.

Features

  • Zero config: widget layout stored server-side, fetched by uid
  • Tree-shakeable: pick /readonly (~42 KB) or /editable (~104 KB)
  • Self-styled: inline CSS, no dependency on host app's CSS framework
  • Light/dark theme: stored in the embed config, switchable
  • All widget kinds: KPI, number grid, bar, line, area, pie, funnel, heatmap, sankey, timeline, table (via the declarative pipeline widget)
  • Auto-refresh: polls for new data every 30s (configurable)
  • Per-widget filter overlay: viewers can narrow a widget by extra tags (browser-only, not saved)
  • Tab navigation: dashboards with multiple tabs get a chip strip
  • Edit mode (/editable only): optional in-browser customization that saves back to server — drag, resize, AI agent, visual editor, JSON editor, snapshot history
  • TypeScript: full type definitions included

License

MIT