| Crates.io | librelink-client |
| lib.rs | librelink-client |
| version | 0.1.4 |
| created_at | 2024-06-20 13:15:17.356758+00 |
| updated_at | 2024-07-18 12:25:22.265076+00 |
| description | SDK for LibreLink |
| homepage | |
| repository | https://github.com/libreconnect/libre-link-client |
| max_upload_size | |
| id | 1277989 |
| size | 16,251 |
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.
$ cargo add librelink-client
There are two ways to initialise the LibreLink client:
#[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.
Checkout our documentation crates.io.