Install

Download the Node.js SDK using your favorite package manager.

npm install @doczilla/node

The package needs to be configured with your organizations API key, which is available on your organizations settings page.

Usage

// app/api/pdf/route.ts -> /api/pdf

import Doczilla from '@doczilla/node'

const doczilla = new Doczilla('doczilla-...')

export async function GET() {
  const pdfBuffer = await doczilla.pdf.direct({
    page: {
      html: '<div>Your first Doczilla PDF</div>'
    }
  })

  return new Response(pdfBuffer, {
    headers: {
      'Content-Type': 'application/pdf'
    }
  })
}

Learn more

Examples Different API endpoint types

Was this page helpful?