Docs

Quickstart: Node

Use this when you are in Node.js or TypeScript and want typed helpers instead of assembling fetch yourself. The client maps 1:1 to REST. For the full method list, see the Node.js SDK guide.

The Node SDK maps 1:1 to REST endpoints and supports binary, URL, and async results. For the full client surface, see the Node.js SDK guide.

Install

Install the official package, then load RELAYPDF_API_KEY from the env file written by relaypdf setup.

Install
npm install @relaypdf/sdk

HTML to PDF

fromHtml sends UTF-8 HTML in the JSON body. save() writes the binary result in Node.

index.ts
import { RelayPDF } from "@relaypdf/sdk";

const client = new RelayPDF({ apiKey: process.env.RELAYPDF_API_KEY! });
const pdf = await client.pdf.fromHtml("<h1>Hello</h1>", { filename: "hello.pdf" });
await pdf.save("hello.pdf");