Generate and process native Word .docx files with the public SDK.
@runstamp/docx is an internal binding name and is not published on npm.
Install
npm install @runstamp/sdkRequires Node.js >=18.14.1.
Quick start
import { runstamp } from "@runstamp/sdk";
import { writeFileSync } from "node:fs";
const input = await fetch("https://runstamp.com/demo-evidence/operation-evidence/docx/docx.render/input.json").then(r => r.json());
const result = await runstamp.operations.run("docx.render", input);
if (!result.ok) throw new Error(result.error.message);
writeFileSync("report.docx", result.value.bytes);Core API (workspace-only)
These engine helpers are for Runstamp workspace development. They are not exports of
@runstamp/sdk, and @runstamp/docx is not on npm. SDK users call runstamp.operations.run.
renderToDocx(input, options?): render JSON to.docx; returns{ buffer }.validateDocxDocument(input): validate against the Zod schema before rendering.hydrateDocx(templateBuffer, data, options?): fill placeholders in a.docxtemplate.scanForPlaceholders(templateBuffer): list placeholders in a template for inspection.renderHtmlToDocx(html, options?): convert HTML to.docx.diffDocxDocuments(a, b)/compareDocuments(a, b): structural diff.
Zod schemas (DocxDocumentSchema, DocxElementSchema, TableElementSchema, etc.) are exported for validation and agent tooling.
Commercial boundary
All local DOCX rendering ships in @runstamp/sdk.
Pro adds company-wide production support and commercial assurance, not a
different package or fidelity gate. See License & Pricing.