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.
Ambulatory Glucose Profile · 14 days
Time in Range
Latest readings
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 binsEverything 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.
One engine. Six packages.
Use exactly the slice you need — the core never carries what you don’t.
| @glucoseiq/core | The zero-dependency headless engine — analytics, series, live model, SVG renderers, interop. |
| @glucoseiq/react | Memoized hooks + headless <AgpChart/>, <TirBar/>, <TrendTile/> components. |
| @glucoseiq/tokens | The canonical five-zone palette, trend glyphs, and CSS variables. |
| @glucoseiq/testing | Seedable mock-CGM generator and scenario fixtures. |
| @glucoseiq/cli | npx @glucoseiq/cli report data.csv — zero-code analysis of any CGM export. |
| diabetic-utils | 2.0 compatibility bridge for projects moving from diabetic-utils 1.5.x. |