Skip to content

coderkearns/dexcom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dexcom

A simple non-official javascript library for reading glucose data from the Dexcom Share API.

Installation

Browser

dexcom can be used client-side (in-browser) by adding the script to your html:

$ curl -sL https://raw.githubusercontent.com/coderkearns/dexcom/master/index.js > dexcom.js
<script src="dexcom.js"></script>

Node.js

dexcom can also be used in node.js, but requires fetch. It can currently be used in Node.js v17.6.x and above.

$ curl -sL https://raw.githubusercontent.com/coderkearns/dexcom/master/index.js > dexcom.js
$ node --version
v17.6.0
$ node --experimental-fetch <file>.js
// <file>.js
const Client = require('./dexcom.js');

Usage

Step 1. Enable the Dexcom Share service on your account

This step only needs to be done once per account.

Download the Dexcom G6 / G5 / G4 app, then enable the Share service.

Step 2. Create a Client instance

const dexcomClient = new Client()

Step 3. Log in to an account

await dexcomClient.login("myUsername", "myPasswordIsCool1*")

Step 4. Get your glucose values

const lastReading = await dexcomClient.fetchLastReading()

console.log(`Reading value is ${lastReading.trend.arrow}${lastReading.mgdl}. The value is ${lastReading.trend.desc}. The value was measured at ${lastReading.time}.`)

const last20ReadingsInTheLast1Hour = await dexcomClient.fetchReadings(60, 20)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Releases

No releases published

Packages

No packages published