Templates that use "use client" components (like Recharts or other chart libraries) need the withPdfn() build plugin to pre-bundle them for rendering.If you followed the Quickstart, this is already set up:
next.config.ts
import { withPdfn } from '@pdfn/next';const nextConfig = { /* your existing config */ };export default withPdfn()(nextConfig);
The plugin detects templates with "use client" directives and bundles them at build time. No additional configuration needed.
Edge runtimes (Vercel Edge, Cloudflare Workers) don’t have filesystem access. The withPdfn() build plugin handles this by pre-compiling Tailwind CSS at build time.What to keep in mind on edge:
Tailwind works — pre-compiled by withPdfn(), no filesystem needed at runtime
Local images and fonts won’t load — use remote URLs or base64 data URIs instead
client.generate() works — connects to pdfn Cloud for PDF generation, no local dependencies needed
Get your key at console.pdfn.dev.Without PDFN_API_KEY, the client uses localhost:3456 automatically. Run npx pdfn dev alongside your Next.js dev server for local development.