Skip to content

libreconnect/libre-link-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub last commit GitHub closed issues GitHub contributors GitHub commit activity

LibreLink Client

Welcome to the LibreLink Client project. This project is a Rust library that provides an interface for interacting with the LibreLink API, a platform that allows users to monitor and manage their glucose levels.

With LibreLink Client, you can easily retrieve glucose data, manage connections, and much more, all directly from your Rust code. Whether you're building a healthcare application, a research tool, or simply want to explore your own glucose data, LibreLink Client is here to help.

Installation

Quick Start

$ cargo add librelink-client

Initialization

There are two ways to initialise the LibreLink client:

  • From credentials
  • From a token
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let client = LibreLinkClient::from_token(token);

  let data = client.get_glucose_history(2,3).await?;

  Ok(())
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = LibreLinkClient::new(Credentials {
      username: "username".to_string(),
      password: "password".to_string(),
    }).await;

    if let Ok(client) = client {
      let _ = client.get_glucose_history(2, 3).await?;
    }

    Ok(())
}

The creation of the client from credentials is asynchronous because the client must make an API call to retrieve the token that is required for the rest of the use of the LibreLinkClient.

Documentation

Checkout our documentation crates.io.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages