Skip to main content
Chromiumly supports API key auth (hosted API), basic auth (Gotenberg 8.4+), and custom HTTP headers.

API key (hosted API)

Used for the hosted API at https://api.chromiumly.dev. When both API key and basic auth are set, the API key takes precedence. Environment:
GOTENBERG_API_KEY=your-api-key
Code:
import { Chromiumly } from "chromiumly";

Chromiumly.configure({ apiKey: "your-api-key" });
See Configuration for full setup.

Basic authentication

Gotenberg supports basic auth from v8.4.0. Example Docker run:
docker run --rm -p 3000:3000 \
  -e GOTENBERG_API_BASIC_AUTH_USERNAME=user \
  -e GOTENBERG_API_BASIC_AUTH_PASSWORD=pass \
  gotenberg/gotenberg:8.4.0 gotenberg --api-enable-basic-auth
Configure Chromiumly via environment:
GOTENBERG_ENDPOINT=http://localhost:3000
GOTENBERG_API_BASIC_AUTH_USERNAME=user
GOTENBERG_API_BASIC_AUTH_PASSWORD=pass
Or with the config library:
{
  "gotenberg": {
    "endpoint": "http://localhost:3000",
    "api": {
      "basicAuth": {
        "username": "user",
        "password": "pass"
      }
    }
  }
}
Or in code:
Chromiumly.configure({
  endpoint: "http://localhost:3000",
  username: "user",
  password: "pass",
});

Custom HTTP headers

For Bearer tokens or other headers, use customHttpHeaders:
const token = await getToken();

Chromiumly.configure({
  endpoint: "http://localhost:3000",
  customHttpHeaders: {
    Authorization: `Bearer ${token}`,
    "X-Custom-Header": "value",
  },
});
These headers are sent with every request to Gotenberg (or the hosted API when using an API key).