SDK

@intactfile/engines is the repair core. Embed it in your own Node service or script — files are repaired in-process and never leave the machine. The engines resolve their own WASM fromnode_modules; there's nothing to wire up. RequiresNode ≥ 22.

Programmatic repair at scale is covered by the Business plan and its terms.

npm install @intactfile/engines

Repair a file

import { NodeFileSource } from "@intactfile/engines/node";
import { repairPdf } from "@intactfile/engines/pdf";
import { writeFile } from "node:fs/promises";

const src = await NodeFileSource.open("broken.pdf");
const { pdf, report } = await repairPdf(src);
await src.close();

console.log(report.outcome); // "success" | "partial" | "failed"
if (report.outcome !== "failed") await writeFile("fixed.pdf", pdf);

License

In Node, repairs require an active Businesssubscription, applied as a signed offline license before you call any repair function. The engines package exports two helpers:

FunctionWhat it does
setLicense(token: string)Apply a license token so repairs can run.
getLicenseStatus()Report whether a valid license is applied, and when it expires.

The simplest path is to also install @intactfile/node-core and call ensureLicense() once at startup — afterintactfile login or once you have a token. It fetches the license and calls setLicense for you.

import { ensureLicense } from "@intactfile/node-core";
import { repairPdf } from "@intactfile/engines/pdf";

// once, at startup — fetches and applies the offline license
await ensureLicense();

// repairs now run as usual

Prefer to manage the token yourself? Call setLicense(token) with a token you already hold, and check getLicenseStatus() before repairing.

Using the engines in the browser requires no license — the gate is Node-only, and the free in-browser widget is unaffected.

Entry points

Feed each engine a ByteSourceNodeFileSource.open(path) or new MemorySource(buffer).

ImportFunction
@intactfile/enginesdetectFormat(src), repairZip(src) (ZIP/Office)
@intactfile/engines/pdfrepairPdf(src)
@intactfile/engines/videoremuxVideo(src), reconstructMoov(broken, reference)
@intactfile/engines/jpegrepairJpeg(src, { reference? })
@intactfile/engines/pngrepairPng(src)
@intactfile/engines/sqliterecoverSqlite(src)
@intactfile/engines/archivesalvageArchive(src, { password? })

Reports

Every *Report carries an honest outcome(success / partial / failed), adamageClass, bytesIn/bytesOut, and human-readable notes. The engines never fake a success — if the data is gone, they say so.

Prefer the CLI or MCP?

If you don't need to embed the library, the CLI andMCP server wrap these same engines with sign-in and licensing handled for you.