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

@aidex/admin-react

v1.0.1

Published

Aidex Admin React adapter — useAdmin(controller) plus a small set of headless, unstyled Admin components (AdminOverview, AIControl, ConnectionList, ObservabilitySummary) over @aidex/admin's AdminController. No business logic — React is the entire concern

Readme

@aidex/admin-react

Installation

pnpm add @aidex/admin-react @aidex/admin react
npm install @aidex/admin-react @aidex/admin react

A single hook, useAdmin(controller), adapting @aidex/admin's AdminController to React. No business logic lives here — every read and command still goes through the same AdminController your application already constructed; this package only translates its existing subscribe()/getSnapshot() into React's external-store contract via useSyncExternalStore.

Usage

import { AdminController } from '@aidex/admin';
import { useAdmin } from '@aidex/admin-react';

// 1. Create/configure AdminController exactly as in @aidex/admin's own
//    docs — the same connectionManager/aiControl instances your app
//    already wired into Aidex.
const admin = new AdminController({ connectionManager, aiControl, observability });

function AdminPanel() {
  // 2. Pass it to useAdmin(controller)
  const snapshot = useAdmin(admin);

  // 3. Read the snapshot
  return (
    <div>
      <p>Health: {snapshot.health}</p>
      <p>AI enabled: {String(snapshot.aiControl.enabled)}</p>
      <p>Connections: {snapshot.connections.length}</p>

      {/* 4. Continue using controller commands directly — no wrapped
             command API, no dispatch layer. */}
      <button onClick={() => admin.setAIEnabled(!snapshot.aiControl.enabled)}>
        Toggle AI
      </button>
    </div>
  );
}

Design notes

  • No AdminProvider, no React Context. admin is passed to useAdmin as a plain argument, the same way you'd pass any object to a hook — there is no ambient/global Admin state to provide. AdminController itself remains the single source of truth; this hook never caches or copies its state.
  • Pass the same controller reference across renders (construct it once — module scope, a ref, or useMemo) so the subscription stays stable; a new controller identity on every render would resubscribe on every render, which is correct behavior for "the controller actually changed" but wasteful if unintended.
  • SSR-safe. AdminController.getSnapshot() is a synchronous in-memory read with no window/document access, so the hook's server snapshot is identical to its client one — no hydration mismatch, no extra code.
  • New AdminSnapshot fields need no adapter change. useAdmin() hands back the whole snapshot generically — snapshot.providers (capability discovery) and snapshot.executions (requested-vs-actual, tokens, cost, duration, success/error) are already available with zero changes to this package. See @aidex/admin's own README for their shape.