license-api

Crates.iolicense-api
lib.rslicense-api
version0.2.11
created_at2025-06-09 23:12:29.98998+00
updated_at2025-08-04 17:54:13.333938+00
descriptionLicense API client library
homepage
repositoryhttps://github.com/awalki/license-api-rs
max_upload_size
id1706479
size59,111
(awalki)

documentation

README

license-api-rs

License API client library made with Rust

Installation

cargo add license-api

Code example

use inquire::{Password, Text};
use license_api::auth::LoginRequest;
use license_api::hwid::get_hwid;
use license_api::auth::LicenseAPI;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut api = LicenseAPI::new("http://localhost:8080");

    let hwid = get_hwid(true, "anything");
    let key = String::from("your-license-key");

    let creds = LoginRequest {
        key,
        hwid,
    };

    if let Ok(true) = api.login(&creds).await {
        println!("✔ Successfully logged in and HWID linked!");
    } else {
        println!("❌ Failed to login");
    }

    Ok(())
}
Commit count: 2

cargo fmt