Integration
Two ways to install: a single page with no server, or embedding into your app (plus optional server-side rendering).
1. Single page — engine and “server” in the browser
Nothing to run: the template is executed by the engine right on the page, the viewer renders, export and printing work in the browser too. Only static hosting is needed (ESM does not work with file://).
cd distro
python3 -m http.server 8000
# → http://localhost:8000/standalone/
2. Embedding into an app (client bundle)
One dependency-free ESM module — viewer + engine. Works in Vue, React, vanilla. Renders entirely in the browser — no separate server-side viewer component.
import { AuViewer, renderTemplate, loadExecutionData } from './aurum-report.js'
const template = await (await fetch('/templates/protocol.json')).json()
const data = await (await fetch('/api/competition/data')).json()
const model = renderTemplate(template, loadExecutionData(data))
const viewer = new AuViewer()
viewer.setModel(model)
document.getElementById('viewer').append(viewer.html)
3. Server-side rendering (optional)
The same engine on the server (Bun): POST /render — template and data → model/export. For heavy reports and server-side PDF.
cd server
PORT=3100 bun run src/server.ts
curl http://localhost:3100/health
# → { "ok": true, "engine": "AuReport JS" }
# POST /render?format=model — body { template, data }
Migrating to AurumReport
Integrate through a standard ESM import, without global functions or manual script-loading orchestration.
// Typical integration via a global function:
const showReport = (window as any).showReport
showReport('viewerContent', template, data, isSuperAdmin)
// AurumReport:
const model = renderTemplate(template, loadExecutionData(data))
viewer.setModel(model)
host.innerHTML = viewer.html