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/enginesRepair 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:
| Function | What 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 usualPrefer 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 ByteSource — NodeFileSource.open(path) or new MemorySource(buffer).
| Import | Function |
|---|---|
@intactfile/engines | detectFormat(src), repairZip(src) (ZIP/Office) |
@intactfile/engines/pdf | repairPdf(src) |
@intactfile/engines/video | remuxVideo(src), reconstructMoov(broken, reference) |
@intactfile/engines/jpeg | repairJpeg(src, { reference? }) |
@intactfile/engines/png | repairPng(src) |
@intactfile/engines/sqlite | recoverSqlite(src) |
@intactfile/engines/archive | salvageArchive(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.