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

@reflexui-jev/react

v0.2.0

Published

Headless React bindings: useAdaptiveSurface, feedback, debug panel.

Readme

@reflexui-jev/react

Headless React bindings. You render the cards; the hook tells you which, in what order, and why.

| Export | Status | | --- | --- | | useAdaptiveSurface({ surfaceId, subjectId, endpoint }) | ready | | feedback(itemId, useful) for "Useful?" buttons | ready | | <DebugPanel trace policy>: scoreboard, alert probabilities, model requests and answers | ready |

const {
  decision,   // what to render now (immediate, then fresh if it lands in the window)
  immediate,  // the first decision received: cache, or default order
  fresh,      // the fresh decision, even when too late to apply
  deferred,   // set when the fresh decision missed the window; applyDeferred() applies it
  trace,      // model I/O and scoreboard, when the server streams it
  freshAfterMs, status, error, feedback, refresh,
} = useAdaptiveSurface({
  surfaceId: "home",
  subjectId,
  endpoint: "/api/surface", // POST { surfaceId, subjectId, ...body } -> NDJSON stream
  body: { env: "staging" }, // optional extra fields; changing it refetches
});

The endpoint streams the immediate decision first and the fresh one when the model answers (decisionStream from core). The hook applies the fresh decision only if it lands within applyWithinMs (default 300) of the request; otherwise it is exposed as deferred (and the server has cached it for the next visit). feedback(itemId, false) posts to ${endpoint}/feedback.

Server side (any framework with Web Response):

const result = await decide({ surface, ctx, subjectId, decider, store, feedback });
return new Response(decisionStream(result), { headers: { "content-type": "application/x-ndjson" } });

Debug panel

import { DebugPanel, useAdaptiveSurface } from "@reflexui-jev/react";

const { trace } = useAdaptiveSurface({ /* ... */ });
<DebugPanel trace={trace} policy={surface.policy} />

Stream the trace with decisionStream(result, { trace: true }). The panel shows the source of the decision, the relevance scoreboard against the policy (promoted, held back, below threshold), alert probabilities, and the raw requests and answers. It is unstyled semantic HTML with reflexui-debug-* class names (or pass className).

The trace contains the signals you send to the model, which may be customer data. Enable it in development or behind an admin check, never for end users.