Quick start
This page walks through your first render — from key to PDF — without touching the dashboard.
Set your API key
Section titled “Set your API key”Export your key into the environment your script runs in:
export POLI_PAGE_API_KEY=pp_test_...Render a PDF
Section titled “Render a PDF”import { PoliPage } from '@poli-page/sdk';
const client = new PoliPage({ apiKey: process.env.POLI_PAGE_API_KEY! });
const pdf = await client.render.pdf({ project: 'billing', template: 'invoice', data: { invoiceNumber: 'INV-001', total: 1280 },});pdf is a Uint8Array. Write it to disk, stream it to S3, or return it directly from an HTTP handler.
Example
Section titled “Example”import { writeFile } from 'node:fs/promises';import { PoliPage } from '@poli-page/sdk';
const client = new PoliPage({ apiKey: process.env.POLI_PAGE_API_KEY! });
const pdf = await client.render.pdf({ project: 'billing', template: 'invoice', data: { invoiceNumber: 'INV-001', total: 1280 },});
await writeFile('./invoice.pdf', pdf);