Skip to main content
createKomgaClient accepts options for auth, timeout, retry, and debug logging.

KomgaClientOptions

interface KomgaClientOptions {
  baseUrl: string;
  auth?: AuthConfig;
  timeout?: number;
  retry?: RetryConfig;
  debug?: boolean;
}

AuthConfig

type AuthConfig =
  | { type: 'basic'; username: string; password: string }
  | { type: 'apiKey'; key: string };

RetryConfig

interface RetryConfig {
  limit?: number;
  methods?: string[];
  statusCodes?: number[];
  backoffLimit?: number;
}

Example

import { createKomgaClient } from 'komga-sdk';

const client = createKomgaClient({
  baseUrl: 'http://localhost:25600',
  auth: { type: 'basic', username: 'admin', password: 'password' },
  timeout: 30000,
  retry: { limit: 3, backoffLimit: 3000 },
  debug: false,
});

Next steps