Papier

Node SDK

Use the Papier Node.js SDK to render templates.

Node SDK

This guide shows how to install and use the official Papier Node.js SDK.

Install

npm install @papier/sdk

Authenticate

Set your API key in an environment variable:

export PAPIER_API_KEY=sk_live_...

Render a template

import Papier from '@papier/sdk'

const client = new Papier({ apiKey: process.env.PAPIER_API_KEY })

const output = await client.render({
  templateId: 'tmpl_123',
  version: 'v1',
  data: { name: 'Alice' },
})

console.log(output.html)

See "Quickstart" for a condensed 5-step tutorial.