GlucoseIQ
API Reference@glucoseiq/core

Connectors

Dexcom, Libre, and Nightscout normalization.

normalizeDexcomEntries

Import: @glucoseiq/core/connectors

normalizeDexcomEntries(entries: DexcomShareEntry[]): NormalizedCGMReading[]

Converts an array of Dexcom Share entries into NormalizedCGMReadings.

Returns: Array of normalized readings, sorted chronologically

ParameterDescription
entriesRaw Dexcom Share entries from any Dexcom client library

normalizeDexcomEntry

Import: @glucoseiq/core/connectors

normalizeDexcomEntry(entry: DexcomShareEntry): NormalizedCGMReading

Converts a single Dexcom Share entry into a NormalizedCGMReading.

Returns: A normalized reading usable by APIs that accept GlucoseReading, subject to each API's contract

Throws: If the date string cannot be parsed

Throws: If the glucose value is not usable

ParameterDescription
entryRaw Dexcom Share entry

normalizeDexcomTrend

Import: @glucoseiq/core/connectors

normalizeDexcomTrend(trend: undefined | null | DexcomTrendString | string & {}): CGMTrend

Maps a Dexcom Share trend string to the shared CGMTrend values.


normalizeLibreEntries

Import: @glucoseiq/core/connectors

normalizeLibreEntries(entries: LibreLinkUpEntry[]): NormalizedCGMReading[]

Converts an array of Libre LinkUp entries into NormalizedCGMReadings.

Returns: Array of normalized readings, sorted chronologically

ParameterDescription
entriesRaw Libre LinkUp entries from any Libre client library

normalizeLibreEntry

Import: @glucoseiq/core/connectors

normalizeLibreEntry(entry: LibreLinkUpEntry): NormalizedCGMReading

Converts a single Libre LinkUp entry into a NormalizedCGMReading.

Returns: A normalized reading usable by APIs that accept GlucoseReading, subject to each API's contract

Throws: If the timestamp cannot be parsed

Throws: If the unit or glucose value is not usable

ParameterDescription
entryRaw Libre LinkUp entry

normalizeLibreTrend

Import: @glucoseiq/core/connectors

normalizeLibreTrend(trend: undefined | null | number): CGMTrend

Maps a Libre LinkUp numeric trend value to the shared CGMTrend values.

Accepts the raw API value (which may be null/undefined or out of range) and returns 'unknown' for any invalid or unmapped values.


normalizeNightscoutDirection

Import: @glucoseiq/core/connectors

normalizeNightscoutDirection(direction: undefined | NightscoutDirection): CGMTrend

Maps a Nightscout direction string to the shared CGMTrend values.


normalizeNightscoutEntries

Import: @glucoseiq/core/connectors

normalizeNightscoutEntries(entries: NightscoutEntry[]): NormalizedCGMReading[]

Converts an array of Nightscout SGV entries into NormalizedCGMReadings.

Returns: Array of normalized readings, sorted chronologically

ParameterDescription
entriesRaw Nightscout entries from the /api/v1/entries endpoint

normalizeNightscoutEntry

Import: @glucoseiq/core/connectors

normalizeNightscoutEntry(entry: NightscoutEntry): NormalizedCGMReading

Converts a single Nightscout SGV entry into a NormalizedCGMReading.

Returns: A normalized reading usable by APIs that accept GlucoseReading, subject to each API's contract

Throws: If neither vendor timestamp can be normalized

Throws: If the glucose value is not usable

ParameterDescription
entryRaw Nightscout SGV entry

parseDexcomDate

Import: @glucoseiq/core/connectors

parseDexcomDate(raw: string): string

Parses a Dexcom date string into an ISO 8601 string.

Dexcom Share returns dates in the format "Date(epochMs)" or "/Date(epochMs)/". This helper handles both, plus plain ISO strings.

Throws: If the date string cannot be parsed


safeNormalizeDexcomEntries

Import: @glucoseiq/core/connectors

safeNormalizeDexcomEntries(entries: DexcomShareEntry[]): SafeNormalizeResult

Safe (partial-success) variant of normalizeDexcomEntries.


safeNormalizeLibreEntries

Import: @glucoseiq/core/connectors

safeNormalizeLibreEntries(entries: LibreLinkUpEntry[]): SafeNormalizeResult

Safe (partial-success) variant of normalizeLibreEntries.


safeNormalizeNightscoutEntries

Import: @glucoseiq/core/connectors

safeNormalizeNightscoutEntries(entries: NightscoutEntry[]): SafeNormalizeResult

Safe (partial-success) variant of normalizeNightscoutEntries.

On this page