#rest #file-upload #strong-typing #rust-sdk #endpoint #open-api-specification #rest-api-client

komga-sdk

Async Rust SDK for the Komga REST API, generated from OpenAPI spec. Supports all endpoints, file upload, and strong typing.

1 stable release

1.23.4 Oct 1, 2025

#238 in HTTP server

Download history 117/week @ 2025-09-28 41/week @ 2025-10-05 13/week @ 2025-10-12 2/week @ 2025-10-19

58 downloads per month

MIT license

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

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 TLS
  • rustls-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


For the full autogenerated API documentation, see API.md.

Dependencies

~7–22MB
~232K SLoC