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

@bloodgpt/widgets

v0.1.0-alpha.0

Published

BloodGPT React widgets — embed report list, test overview, parameters, and follow-ups in your own app

Readme

@bloodgpt/widgets

Drop-in React widgets that render BloodGPT reports inside your own application.

Status — v0.1.0-alpha. Code-complete on feature/widgets-package: the backend endpoints (/api/v1/widget-sessions, /api/v1/widgets/...) and every widget below are implemented. Not yet published to npm and the branch isn't merged, so WIDGET_SESSION_SECRET must be set in the target environment before the API serves tokens.

Install

npm install @bloodgpt/widgets @tanstack/react-query next-intl

Peer dependencies:

  • react ≥ 18
  • react-dom ≥ 18
  • @tanstack/react-query ≥ 5
  • next-intl ≥ 4

Import the stylesheet once in your app entry (e.g. app/layout.tsx):

import "@bloodgpt/widgets/styles.css";

Authentication

The widgets never see your API key. Your backend mints short-lived session tokens scoped to a single patient:

// in your server (Next.js route handler, Express, etc.)
const res = await fetch("https://sandbox.bloodgpt.com/api/v1/widget-sessions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BLOODGPT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    external_patient_id: "your-patient-id",
    ttl_seconds: 900, // optional, default 900 (15 min)
  }),
});
const { session_token } = await res.json();

Hand session_token to the browser and pass it to the provider:

import { BloodGPTProvider, TestOverview } from "@bloodgpt/widgets";

export function PatientPage({ token, testId }: Props) {
  return (
    <BloodGPTProvider sessionToken={token}>
      <TestOverview testId={testId} />
    </BloodGPTProvider>
  );
}

Widgets

  • <ReportsList externalPatientId> — the patient's reports, newest first
  • <TestOverview testId> — patient demographics + scan metrics + narrative summary
  • <TestParameters testId> — biomarker panels with filtering, sparklines, and per-parameter trend charts
  • <TestFollowUps testId> — follow-up schedule + priority retests
  • <TestReport testId> — composite of overview + parameters + follow-ups (the most common embed)

Each widget also exports a hook (useReports, useTestOverview, useTestParameters, useTestFollowUps, useTestTrends) for customers who want raw data plus their own rendering.

Trends

<TestParameters> renders value-over-time charts inline once a parameter has more than one measurement. For a standalone chart, pull the series with useTestTrends(testId, parameterName) and render it with your own chart or with TrendsChart from @repo/analysis-ui:

const { data } = useTestTrends(testId, "Hemoglobin");
// data?.trend is { parameterName, trend: { <ISO date>: number | null }, unit, ... }

Locales

English ships bundled. Pass additional messages via the messages prop on BloodGPTProvider:

import esMessages from "./bloodgpt-es.json";

<BloodGPTProvider
  sessionToken={token}
  locale="es"
  messages={esMessages}
>
  ...
</BloodGPTProvider>;

Internal notes

This package is built from the packages/analysis-ui view components and the public REST surface of apps/b2b-api. The adapter pattern is:

<Widget> = useQuery via the bundled HttpClient → render <View> from @repo/analysis-ui

The package ships its own ~50-line HttpClient rather than depending on a separate SDK — a standalone @bloodgpt/sdk is only worth extracting once a non-React client needs a typed API client without the widgets.

@repo/analysis-ui is bundled into the published artifact (via tsup noExternal) so customers don't need access to monorepo sources. Its chart renderer pulls in chart.js, which is bundled alongside it.