komga-sdk

Crates.iokomga-sdk
lib.rskomga-sdk
version1.23.4
created_at2025-10-01 18:08:06.814086+00
updated_at2025-10-01 18:08:06.814086+00
descriptionAsync Rust SDK for the Komga REST API, generated from OpenAPI spec. Supports all endpoints, file upload, and strong typing.
homepage
repository
max_upload_size
id1863149
size1,408,690
Piotr Boruc (wasilak)

documentation

README

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.

Commit count: 0

cargo fmt