Choose the runtime
| Runtime | Use it for | Requirements |
|---|---|---|
| Browser Editor / SDK + Canvas | Interactive authoring, local viewing, templates and exports | Browser assets, fonts and a sized host. No rendering server required. |
| Node SDK | Queries, extraction, edits, forms and template generation | @onodocs/sdk. No browser required for data operations. |
| Node server renderer | Paginated output, page images and PDF | @onodocs/sdk/server, playwright-core, installed Chrome/Chromium and fonts. |
| Backend + Canvas | Server-prepared pages displayed by a browser | Authenticated manifest/page endpoints and @onodocs/canvas. |
| Collaboration / Agent | Shared sessions or model-assisted work | Application authentication, storage and optional service/provider configuration. |
The public sample setup guide lists exact commands. Use SDK/Canvas integration for lower-level examples.
Ship browser assets and fonts
Bundle public package imports with your application and serve over HTTPS or localhost. Deploy generated lazy chunks, including PDF output chunks. Agent scripting additionally needs its module worker and WebAssembly resources. Configure CSP for the actual workers, font/image origins and Blob/data resources your integration uses.
Supply document fonts for repeatable pagination. A toolbar font name does not load the font. Cache scripts, fonts and documents when offline operation is needed; adding an application save callback makes that workflow network-dependent. React and other SSR frameworks mount browser components only on the client.
Reuse a server renderer
npm install @onodocs/sdk playwright-coreimport { readFile, writeFile } from "node:fs/promises";
import { createRenderer } from "@onodocs/sdk/server";
const renderer = await createRenderer({ channel: "chrome" });
try {
const document = await renderer.openDocument(await readFile("input.docx"));
try {
await writeFile("output.pdf", await document.pdf({ dpi: 150 }));
} finally { await document.dispose(); }
} finally { await renderer.dispose(); }Install Chrome separately or use the renderer options for your Chromium installation. Long-running services reuse the renderer and dispose each document. Supply fonts as data URLs or install them on the host; renderer document contexts make no outbound requests. The browser example and server renderer share document processing and PDF output.
Offer an HTTP service
createHttpService({ renderer, authorize, document, onError }) from @onodocs/sdk/http supplies upload, page manifest, page, DOCX/PDF export and deletion routes. Authenticate each request with a stable application-owned principal. Call its handler from a Node listener and dispose the service before the renderer.
| Request | Result |
|---|---|
| POST /documents | Upload raw DOCX; returns id, URL and page count. |
| GET /documents/:id | Canvas manifest. |
| GET /documents/:id/pages/:index | Prepared page; index starts at zero. |
| GET /documents/:id/docx or /pdf | Export document bytes. |
| DELETE /documents/:id | Release the process-local session. |
Keep durable files in your application storage. Sessions disappear on restart; edited bytes create a new session. Forward every route through the authenticated gateway and route requests to the owning process. Delete sessions in finally blocks, including after failed exports. See the Node service and Node/Python/C# clients.
Connect application operations
Run an unprivileged service behind TLS with browser sandbox support, process supervision and protected environment secrets. On startup, check an authenticated upload, export and deletion with the deployed fonts. Stop requests and allow cleanup during shutdown.
Your application owns authorization, durable storage, ETags/conflict UI, retention and backups. Use application sessions for acknowledged saving, collaboration for shared records and Agent for optional model work. Production licensing applies to the named application across its frontend and backend.