The 1.0 call shape
Create a client once, then pass it in the operation options. Operation parameters are flat: endpoint inputs are properties of the first argument rather than nested transport-slot objects.{ data, error, request, response }. It does not throw for an API error by default. Use unwrap when a call site should throw a KomgaApiError instead.
For an operation with no endpoint parameters, the options object is the only argument. For example, call
getLibraries({ client }).Operation families
The generated barrel re-exports operation functions and their generated response and error types. Common operations include:
The generated types are the source of truth for each operation’s parameters and response. The API Reference links to the Komga 1.25.0 OpenAPI document used by the generated surface.
Build a domain workflow in your application
A domain workflow can compose operations without reintroducing a second SDK abstraction:Common book workflows
Read book details and pages as separate generated operations:204 No Content on success:
page or completed according to the generated ReadProgressUpdateDto:
Series, library, and administrative workflows
Series metadata and library configuration mutations carry permissions documented on the generated operation. For example:ADMIN or another role. A 403 should be surfaced to the operator; do not retry unchanged credentials. Library scans are server-side work and may complete after the operation returns, so track task state through the Komga endpoints or UI rather than treating the request as a synchronous import.
Collections and read lists
These endpoints are not domain-service methods in 1.0. Call them directly with their generated query names:content ?? [] and inspect error before rendering page data. See Pagination for list iteration and sorting.
Migration from service wrappers
Replace a service method with an operation import and a client option:
Wrap the new call with
unwrap only if throwing behavior is preferable. BookSearch currently contains fullTextSearch and an optional generated condition; pass that generated shape directly instead of the former service-layer search object.
What moved to the application
The core SDK intentionally stays close to Fetch and the generated contract:- Runtime response validation is optional and consumer-owned. See Runtime validation.
- Retries, caching, pagination state, and query-library integration belong in the application layer.
- Request and response lifecycle hooks are low-level generated-client interceptors. See Request customization.
- HTTP failures are represented in the result or converted to
KomgaApiErrorbyunwrap. See Result handling.
Next steps
Direct API functions
Call generated operations with flat parameters.
Pagination
Handle generated page responses and list parameters.
Configuration
Configure authentication and Fetch behavior.