Rendering
Render documents as PDF, HTML, or shareable links.
// title: Render PDF
const pdf = await sdk.invoices.renderPdf(invoice.id);
// With options
const pdfCustom = await sdk.invoices.renderPdf(invoice.id, {
template: "modern",
locale: "de",
});Options: template (modern, classic, minimal), locale (en-US, de-DE, etc).
HTML
For embedding in web apps:
// title: Render HTML
const html = await sdk.invoices.renderHtml(invoice.id);
// Embed in your app
document.getElementById("invoice-preview").innerHTML = html;Public Links
Share documents without authentication:
// title: Public sharing link
const share = await sdk.invoices.share(invoice.id);
console.log(share.url);
// https://app.spaceinvoices.com/share/abc123...
// Customers can view without login