🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@rendoc/sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rendoc/sdk

Official rendoc SDK for JavaScript/TypeScript - PDF generation API

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

rendoc

Official JavaScript/TypeScript SDK for rendoc - PDF generation API.

Zero dependencies. Works with Node.js 18+, Bun, Deno, and browsers.

Installation

npm install rendoc

Quick Start

ESM

import { Rendoc } from "rendoc";

const client = new Rendoc({ apiKey: "rnd_..." });

// Generate a PDF from markup
const doc = await client.documents.generate({
  markup: "<h1>{{title}}</h1><p>{{body}}</p>",
  data: { title: "Invoice #001", body: "Thank you for your purchase." },
  paperSize: "A4",
  filename: "invoice.pdf",
});

console.log(doc.downloadUrl);

CommonJS

const { Rendoc } = require("rendoc");

const client = new Rendoc({ apiKey: "rnd_..." });

Usage

Generate a PDF from a template

const doc = await client.documents.generate({
  templateId: "tmpl_123",
  data: { name: "John Doe", amount: 99.99 },
});

Retrieve a document

const doc = await client.documents.get("doc_abc123");

List templates

const templates = await client.templates.list();

// Filter by category
const invoices = await client.templates.list({ category: "INVOICE" });

Create a template

const template = await client.templates.create({
  name: "Invoice",
  slug: "invoice",
  markup: "<h1>Invoice for {{name}}</h1>",
  schema: { type: "object", properties: { name: { type: "string" } } },
});

Manage API keys

const keys = await client.apiKeys.list();

const newKey = await client.apiKeys.create({
  name: "production",
  scopes: ["documents:write"],
});

Check usage

const usage = await client.usage.get();
console.log(`${usage.usage.documents}/${usage.usage.limit} documents used`);

// Historical usage
const jan = await client.usage.get({ year: 2026, month: 1 });

Error Handling

import { Rendoc, AuthenticationError, RateLimitError } from "rendoc";

try {
  const doc = await client.documents.generate({ ... });
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error("Invalid API key");
  } else if (error instanceof RateLimitError) {
    console.error("Rate limited, retry later");
  }
}

Custom Base URL

const client = new Rendoc({
  apiKey: "rnd_...",
  baseUrl: "https://custom.rendoc.dev",
});

Documentation

Full API documentation at https://rendoc.dev/docs.

License

MIT

Keywords

pdf

FAQs

Package last updated on 24 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts