Skip to content

Releases: cloudlayerio/cloudlayerio-js

v0.1.0

16 Mar 23:23

Choose a tag to compare

@cloudlayerio/sdk v0.1.0

Initial release of the official TypeScript/JavaScript SDK for the CloudLayer.io document generation API.

Features

  • 10 conversion methods: urlToPdf, urlToImage, htmlToPdf, htmlToImage, templateToPdf, templateToImage, docxToPdf, docxToHtml, pdfToDocx, mergePdfs
  • 12 data management methods: jobs, assets, storage, account, status, templates
  • Utility methods: downloadJobResult, waitForJob (polling with cost-conscious defaults)
  • 42 TypeScript interfaces matching the legacy v1/v2 API
  • 7 error classes with status code mapping and request context
  • HTTP transport with native fetch, retry logic (exponential backoff), multipart support
  • Client-side input validation for all endpoints
  • 113 unit tests with 90% coverage
  • Dual ESM/CJS output with TypeScript declarations
  • Zero runtime dependencies (Node 20+ native fetch)

Install

npm install @cloudlayerio/sdk

Quick Start

import { CloudLayer } from "@cloudlayerio/sdk";

const client = new CloudLayer({
  apiKey: "your-api-key",
  apiVersion: "v2",
});

const { data: job } = await client.urlToPdf({ url: "https://example.com" });
const pdf = await client.downloadJobResult(job);