Node.js SDKServer-side · TypeScript first

BladePDF for Node.js

The official @bladepdf/node package brings BladePDF's render client, fluent options, secure local asset pipeline, background submissions, and webhook verification to server-side Node.js.

Server-only package

Use the SDK only in trusted backend code. It uses Node filesystem and stream APIs and must not be bundled into a browser, exposed through client components, or shipped with an API key.

Install

Terminal
bash
 1npm install @bladepdf/node

Node.js 22 or newer is required. The package ships ESM, CommonJS, and TypeScript declarations and has no runtime dependencies.

ESM
javascript
 1import { BladePdf } from '@bladepdf/node';
CommonJS
javascript
 1const { BladePdf } = require('@bladepdf/node');

What is in the SDK

ComponentResponsibility
BladePdf and PendingRenderHTML and cloud-template sources, PDF options, readiness, metadata, storage, webhooks, and delivery.
BladePdfClientNative multipart transport, timeouts, retry policy, stored-PDF links, request IDs, and structured failures.
AssetResolverPermission-scoped HTML and CSS discovery for local CSS, fonts, images, JavaScript, and SVG.
Result typesBuffer, Node Readable, atomic file delivery, stored URL, and request ID.
verifyWebhookSignature()Framework-independent HMAC and timestamp verification over exact raw body bytes.

Bring your own template engine

Handlebars, EJS, Pug, React server rendering, Nunjucks, and other engines remain application concerns. Render a template to a final HTML string, then call fromHtml(). The SDK does not add a template-engine dependency.

Node-native delivery

MethodUse it for
render()Return a RenderResult containing the complete PDF as a Buffer.
renderStream()Return a one-shot Node Readable for HTTP responses or custom pipelines.
renderToFile()Stream through a temporary sibling and safely commit a complete local file.
submit()Accept a stored background render and return its request ID without waiting for PDF generation.

Next step

Continue with the Node.js SDK quickstart, then configure only the asset roots your documents require.