TypeScript clients for Docling.
- Convert documents to Markdown, HTML, text and structured JSON.
- API: Docling Serve performs conversion, chunking and S3 work; the SDK sends requests and tracks tasks.
- CLI: Node runs an installed Python Docling command for local conversion and batch work.
- Web OCR: a browser worker runs a downloaded model on images; PDF pages first render to images with optional
unpdf. - Clients share conversion methods but have different capabilities; choose by where processing should run. Web does not parse Office/HTML inputs or support file-output methods.
- Portable binary input is
Uint8Array; filesystem and stream behavior depend on the method and runtime. - Ordinary conversion returns a document response;
safeConvertwraps rejection. File-output methods have a separate success/failure contract. - The package publishes ESM. Browser API use starts with
createAPIClientfromdocling-sdk/browser; local OCR starts withcreateWebClientfromdocling-sdk/web.
npm install docling-sdkAPI mode needs a running Docling Serve instance. CLI mode needs Python Docling installed locally and Node.js >=18. Node API usage also requires Node.js >=18.
For browser OCR, install its optional peers:
npm install @huggingface/transformers onnxruntime-web
# Also needed for Web PDF rendering:
npm install unpdfimport { readFile } from "node:fs/promises";
import { createAPIClient } from "docling-sdk";
const client = createAPIClient("http://localhost:5001");
const result = await client.convert(await readFile("input.pdf"), "input.pdf", {
to_formats: ["md"],
});
console.log(result.document.md_content);- Getting started — setup and examples for all three modes
- Guides and reference — configuration, features and client methods
- Runtime entry points — browser imports and worker setup
- Transfer behavior — buffering, streams and byte output
- Architecture decisions — rationale and superseded choices
- Examples · Contributing