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 🙏

© 2024 – Pkg Stats / Ryan Hefner

libre-link-unofficial-api

v1.0.0-alpha.3

Published

An unofficial API for Libre Link Up (glucose monitoring system/CGM)

Downloads

7

Readme

🩸 Unofficial Libre Link Up API for Node.js

npm version GitHub license 🧪 Tests

Welcome to the unofficial Node.js API for Libre Link Up! This library is designed to help you interact with your CGM data from your Freestyle Libre 2/3 stored inside Abbott's database directly from your Node.js applications. Please note that this library is not officially supported by Abbott/Freestyle and was reverse engineered for educational purposes.

⚠️ The library is in alpha and may not work as expected, breaking changes may occur. Please open an issue if you encounter any problems.

🚀 Getting Started

First, install the library using either

npm

npm install libre-link-unofficial-api

or

bun

bun install libre-link-unofficial-api

Then, you can import the LibreLinkClient from the library:

import { LibreLinkClient } from 'libre-link-unofficial-api';

You'll need to provide an email and password for your Libre Link Up account either in the .env file or when creating a new LibreLinkClient instance:

const client = new LibreLinkClient({ email: 'your-libre-link-up-email', password: 'your-libre-link-up-password' });

Please make sure that the email and password work with the Libre Link Up mobile application before using them with this library.

📚 API

Options

The LibreLinkClient constructor accepts the following options:

Option | Description | Default --- | --- | --- email | The email address for your Libre Link Up account. Will fallback to env variables, if not provided. | undefined password | The password for your Libre Link Up account. Will fallback to env variables, if not provided. | undefined patientId | The patient ID for the user. Will fallback to env variables, if not provided. | undefined cache | Whether to enable cache for request responses received from Libre Link Up api. Data like blood glucose readings will never be cached. | true

Methods

The LibreLinkClient provides access to the following methods:

Method | Description | Status --- | --- | --- login | Login to the Libre Link Up API. | ✅ me | Get the current cached user. | ✅ read | Get the raw reading. | ✅ stream | Stream the readings. | ✅ history | Get the history of readings. | ✅ fetchReading | Fetch the raw reading from the Libre Link Up API. Use read for parsed readings. | ✅ fetchConnections | Fetch the connections between LinkUp account and Libre app. | ✅

More methods will be added in the future. If you need a specific method, please open an issue or submit a pull request!

📖 Examples

Create a new LibreLinkClient

It's necessary to create a new LibreLinkClient instance to interact with the Libre Link Up API. Otherwise any method listed below will throw an error.

import { LibreLinkClient } from 'libre-link-unofficial-api';

const client = new LibreLinkClient({ email: 'your-libre-link-up-email', password: 'your-libre-link-up-password' });

Log into Libre Link Up

await client.login();

Get current user

const user = client.me;

Get a blood glucose reading

const reading = await client.read();

console.log(reading.value);

Stream the blood glucose readings. (Every 1.5min by default)

// Stream the readings every 1.5min (can be changed via arguments)
const stream = client.stream();

for await (const reading of stream) {
    const { value, timestamp, trendType } = reading;

    console.log(value, " - ", timestamp.toTimeString());
    console.log(`Trend ${trendType}`);

    // Use break; to stop the stream.
    // if(value > 150) break;
}

Check out the Sandbox directory for more samples.

⚠️ Disclaimer

This library was reverse engineered from the Libre Link Up API and resources available online; and may be incomplete or inaccurate. The library is not associated with Abbott or Freestyle. Use at your own risk.

Every 12 hours a Github Action runs to test the library against the Libre Link Up API. If the tests fail, the library may be out of date. Please open an issue or submit a pull request if you notice any issues. Thanks!

🧪 Tests

🙏 Acknowledgements

Big thanks to the author of the libre-link-up-api-client library for reverse engineering the Libre Link Up API — your work inspired this library! 🚀

📝 License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.