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

@aindy/ui-kit

v2.1.0

Published

Shared UI components, contexts, and API core for the AINDY platform

Readme

@aindy/ui-kit

Shared UI components, React contexts, and API core for AINDY platform frontends.

@aindy/ui-kit is the client-side counterpart to the aindy-runtime backend: it centralizes the authenticated HTTP layer, the canonical backend route table, auth/session contexts, and a small set of shared components and UI primitives so every frontend built on the runtime talks to it the same way. It is published to npm and consumed as a compiled bundle (dist/ is built at publish time, not committed).

Install

npm install @aindy/ui-kit

Peer dependencies (provided by the host app):

  • react ^19
  • react-dom ^19
  • react-router-dom ^6

What it exports

API core (./api/_core.js)

The authenticated request layer against the runtime. buildApiUrl prepends API_BASE to a ROUTES value; the request family attaches the stored token and returns the parsed body.

| Export | Purpose | |---|---| | request, authRequest, adminRequest, taggedRequest, requestAbsolute | HTTP calls (auth-scoped / admin-scoped / cache-tagged / absolute-URL variants) | | buildApiUrl | Resolve a ROUTES value against API_BASE | | getStoredToken, setStoredToken, clearStoredToken | JWT storage | | unwrapEnvelope | Unwrap the runtime's { data: … } response envelope | | ApiError | Typed error carrying status + body | | API_BASE | Build-time API base (VITE_API_BASE_URL, default "" — relative to origin) |

Routes (./api/_routes.js)

  • ROUTES — the canonical backend route table. Every runtime/platform route carries the full /platform prefix (e.g. ROUTES.OPERATOR.FLOW_STRATEGIES → /platform/flows/strategies). A value that drops the prefix segment 404s.
  • FEATURE_FLAGS — NavLink gates for routes that are conditionally served; flip a flag to true when its backing runtime route lands.

Runtime routes vs app routes. ROUTES should carry runtime/platform paths only — these are shared by every consumer, and the runtime's authoritative list lives in aindy-runtime docs/runtime/UI_CONTRACT.md. App-domain paths (e.g. /compute/* analytics, /seo/*) are not runtime routes and must not be baked into this shared kit; a consuming app owns those in its own route map that spreads and extends ROUTES (mirroring the backend's runtime/app split).

Auth (./api/auth.js)

bootIdentity, loginUser, registerUser.

Invariant: all three must .then(unwrapEnvelope) — bootIdentity populates system.runtime.boot_mode (read by the post-login redirect); returning the raw envelope silently breaks it.

Contexts

  • AuthProvider / useAuth — session + identity.
  • SystemProvider / useSystem — runtime system state (incl. boot_mode).

Components

AppShell, ProtectedRoute, VersionMismatchBanner, Toast, LoadingPanel, DomainError, AdminAccessRequired (+ useAdminApiGuard), EmptyState.

UI primitives

Button (+ buttonVariants), the Card family (Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter), the Tooltip family (Tooltip, TooltipTrigger, TooltipContent, TooltipProvider).

Utilities

cn (class merge), APPROVAL_EVENT, useApiCall, useToast, safeArray, safeMap.

Usage

import {
  AuthProvider, SystemProvider, ProtectedRoute, AppShell,
  ROUTES, request, unwrapEnvelope,
} from "@aindy/ui-kit";

function App() {
  return (
    <AuthProvider>
      <SystemProvider>
        <AppShell>{/* routes */}</AppShell>
      </SystemProvider>
    </AuthProvider>
  );
}

// A backend call through the canonical route table:
const strategies = await request(ROUTES.OPERATOR.FLOW_STRATEGIES).then(unwrapEnvelope);

Development

npm run build    # vite build → dist/ (index.js, index.cjs, index.d.ts)
npm run lint     # eslint src
npm test         # vitest

Versioning & the runtime

@aindy/ui-kit and aindy-runtime are independently versioned. This package consumes the runtime's HTTP contract; the runtime does not depend on it. A ui-kit release does not require a runtime release (and vice versa) — a runtime bump is only relevant when a ui-kit change depends on a new runtime route or behavior. Keep ROUTES in sync with the runtime's docs/runtime/UI_CONTRACT.md; a route that drifts from a served backend path is the UIKIT-ROUTE-DRIFT-1 failure mode.

Publishing

dist/ is gitignored and built fresh at publish:

npm version patch        # e.g. 1.0.5 → 1.0.6
npm run build
npm publish