Glucose intelligence. On every screen.

The zero-dependency TypeScript engine for CGM analytics — the AGP, Time-in-Range, 25+ cited metrics, meal response, and a live trend model. Headless by design.

$ npm install @glucoseiq/core
95excellent
Today
89·213·106
low · high · now (mg/dL)
GMI
6%
est. A1C
Time in Range
96.9%
target ≥70% · 70–180
Variability
20.7%
CV · stable
Episodes
2 · 10
hypo · hyper (≥15 min)

Ambulatory Glucose Profile · 14 days

70180547014018025012 AM6 AM12 PM6 PM12 AM

Time in Range

High 1.8%In Range 96.9%Low 0.3%Very Low 0.9%

Latest readings

106
mg/dL
now
103
mg/dL
5 min ago
96
mg/dL
10 min ago
108
mg/dL
15 min ago

One call. The whole report.

import { analyzeGlucose } from '@glucoseiq/core'

const report = analyzeGlucose(readings)

report.gmi                // 6
report.timeInRange        // 96.9% in 70–180
report.risk.gri.zone      // 'A'
report.episodes.summary   // 2 hypo · 10 hyper
report.agpProfile.bins    // 288 time-of-day bins
The engine

Everything a CGM app needs.
Nothing it doesn’t.

Researcher-grade math. Dashboard-grade primitives. Apple-grade restraint.

The AGP series, finally.

buildAGPProfile() returns the time-of-day percentile bands every CGM dashboard renders — render-ready for any chart library, or use the built-in SVG.

25+ cited metrics.

TIR, TITR, GMI, MAGE, LBGI/HBGI, ADRR, GRADE, GRI, MODD, CONGA, M-value, IGC, GVI/PGS, MAG, GVP — every formula traces to a published source, golden-tested.

Meal response.

Baseline, peak, delta, time-to-peak, return-to-baseline, and Wolever iAUC. The “what did that bagel do?” card in one pure function.

A live model.

Rate-of-change, derived trend arrows, and sensor staleness — backfilled even when a feed lacks trend. The beating heart of a CGM home screen.

Events, not just percentages.

Consensus ≥15-minute hypo/hyper episodes with level, duration, and nadir — the overnight low that percent-time hides.

Zero dependencies.

~15 KB gzipped. 100% test coverage. Strict TypeScript. Unit-safe in mg/dL and mmol/L. FHIR CGM IG and Open mHealth interop included.

The ecosystem

One engine. Six packages.

Use exactly the slice you need — the core never carries what you don’t.

@glucoseiq/coreThe zero-dependency headless engine — analytics, series, live model, SVG renderers, interop.
@glucoseiq/reactMemoized hooks + headless <AgpChart/>, <TirBar/>, <TrendTile/> components.
@glucoseiq/tokensThe canonical five-zone palette, trend glyphs, and CSS variables.
@glucoseiq/testingSeedable mock-CGM generator and scenario fixtures.
@glucoseiq/clinpx @glucoseiq/cli report data.csv — zero-code analysis of any CGM export.
diabetic-utils2.0 compatibility bridge for projects moving from diabetic-utils 1.5.x.
Every chart and number on this page is computed at build time by @glucoseiq/core over deterministic @glucoseiq/testing data — no chart library, no client JS.
Informational and educational purposes only — not medical advice. MIT © Mark Learst.