import { Chromiumly, Templates } from "chromiumly";
Chromiumly.configure({
apiKey: process.env.CHROMIUMLY_API_KEY!,
});
const templates = new Templates();
const buffer = await templates.generate({
type: "invoice_saas",
data: {
invoiceNumber: "INV-319",
createdDate: "2026-03-19",
dueDate: "2026-04-02",
sender: {
name: "Acme Cloud LLC",
addressLine1: "450 Madison Ave",
addressLine2: "New York, NY 10022",
},
receiver: {
name: "Northwind Health Inc.",
addressLine1: "221 Harbor Blvd",
addressLine2: "San Diego, CA 92101",
},
items: [
{
description: "Platform Subscription",
qty: 1,
unitPrice: "1500.00",
amount: "1500.00",
},
],
currency: "USD",
subTotal: "1500.00",
taxRate: 8.25,
taxAmount: "123.75",
total: "1623.75",
footerNote: "Payment due in 14 days.",
},
});