Skip to main content
Run a URL-to-PDF conversion using the hosted API or a local Gotenberg instance.

Prerequisites

  • A supported runtime: Node.js 18+, Deno 1.x, or Bun
  • For hosted API: an API key from chromiumly.dev
  • For self-hosted: Docker and a running Gotenberg container (e.g. docker run --rm -p 3000:3000 gotenberg/gotenberg:8)

Step 1: Install

Step 2: Configure (pick one)

Hosted API — set your API key so requests go to https://api.chromiumly.dev:
Or in code:
Self-hosted — point to your Gotenberg URL:
Or in code:

Step 3: Convert a URL to PDF

The buffer contains the PDF bytes (a Buffer in Node, or the runtime’s equivalent). Write it to a file, pipe it to a response, or pass it to PDFEngines.generate for a convenience helper.

Next steps

  • Installation — package managers and prerequisites
  • Configuration — dotenv, config lib, and Chromiumly.configure()
  • Chromium — HTML and Markdown conversion, screenshots, and options