Skip to main content
Static configuration class. Call Chromiumly.configure() once to set the Gotenberg endpoint or hosted API key and optional auth.

configure(config)

Sets endpoint, API key, basic auth, and custom headers. All keys are optional.
Chromiumly.configure({
  endpoint?: string;       // e.g. "http://localhost:3000"
  username?: string;        // basic auth
  password?: string;       // basic auth
  apiKey?: string;        // hosted API; sets endpoint to https://api.chromiumly.dev if endpoint not set
  customHttpHeaders?: Record<string, string>;
}): void
  • If only apiKey is set, the library uses https://api.chromiumly.dev as the endpoint.
  • Environment variables (GOTENBERG_ENDPOINT, GOTENBERG_API_KEY, GOTENBERG_API_BASIC_AUTH_USERNAME, GOTENBERG_API_BASIC_AUTH_PASSWORD) are used when no value was set via configure().

Static constants (internal use)

  • Chromiumly.CHROMIUM_CONVERT_PATH'forms/chromium/convert'
  • Chromiumly.CHROMIUM_SCREENSHOT_PATH'forms/chromium/screenshot'
  • Chromiumly.PDF_ENGINES_PATH'forms/pdfengines'
  • Chromiumly.LIBRE_OFFICE_PATH'forms/libreoffice'
  • Chromiumly.CHROMIUM_ROUTES, PDF_ENGINE_ROUTES, LIBRE_OFFICE_ROUTES — route names for each engine
Conversion and screenshot classes call Chromiumly.getGotenbergEndpoint() (and auth getters) internally; you do not need to call these directly unless you are extending the library.