1 stable release
| 1.23.4 | Oct 1, 2025 |
|---|
#238 in HTTP server
58 downloads per month
1MB
15K
SLoC
Komga Rust SDK
A modern, async Rust client for the Komga REST API, generated and maintained with best practices for real-world use.
Features
- Full async support (tokio-based)
- All Komga API endpoints covered
- File upload support (multipart)
- Strongly typed models
- Native TLS and Rustls support (feature flags)
Documentation
- API Reference: See API.md for the full autogenerated API documentation.
- Komga API Reference:
Installation
Add to your Cargo.toml:
[dependencies]
komga-sdk = "1.23.4"
# or, for local development:
# komga-sdk = { path = "./komga-sdk" }
Feature Flags
native-tls(default): Use system TLSrustls-tls: Use Rustls for TLS
Usage Examples
Authentication
use komga_sdk::apis::configuration::Configuration;
let mut config = Configuration::new();
config.api_key = Some(komga_sdk::apis::configuration::ApiKey {
key: "YOUR_API_KEY".to_string(),
prefix: None,
});
// or for basic auth:
config.basic_auth = Some(("user".to_string(), Some("pass".to_string())));
Get Current User
use komga_sdk::apis::current_user_api::get_current_user;
let user = get_current_user(&config).await?;
println!("Current user: {user:?}");
File Upload Example
use komga_sdk::apis::book_poster_api::add_user_uploaded_book_thumbnail;
let result = add_user_uploaded_book_thumbnail(
&config,
"book_id",
std::path::PathBuf::from("/path/to/cover.jpg"),
Some(true)
).await?;
println!("Uploaded thumbnail: {result:?}");
Testing
- To run tests:
cargo test - For integration tests, you need a running Komga instance (see Komga Docker).
- You may use the public demo server for read-only tests, but write operations require your own instance.
Contributing
Pull requests and issues are welcome! Please see CONTRIBUTING.md if available.
License
MIT
Kudos & Acknowledgements
- Generated using OpenAPI Generator
- Powered by Komga and its open API
- Thanks to all open-source contributors
For the full autogenerated API documentation, see API.md.
Dependencies
~7–22MB
~232K SLoC