惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
量子位
T
Tailwind CSS Blog
Vercel News
Vercel News
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
U
Unit 42
Engineering at Meta
Engineering at Meta
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
D
Docker
博客园_首页
P
Proofpoint News Feed
月光博客
月光博客
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Martin Fowler
Martin Fowler
腾讯CDC
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Inside Nutrient

A guide to the invisible work behind documents Introducing Nutrient Documents for Salesforce: Native document generation and signing Document AI vs. traditional OCR: Choosing between OCR, AI, and hybrid pipelines PDF SDK compliance and security evaluation checklist for enterprise teams (2026) Invariant Corp replaces paper processes with Nutrient Workflow and scales without limits What is process mapping? A complete guide Nutrient vs. Conga Composer for Salesforce document generation (2026) Document routing: How to automate document distribution The CTO’s AI playbook: Why accountability architecture beats orchestration Compliance workflow automation: Why built-in compliance is table stakes Workflow diagrams: Examples, symbols, and how to build one that actually runs Digital forms: Replace paper forms with automated workflows Approval workflow software: How to automate approvals Why document-centric automation is different The CEO’s AI playbook: Why decision architecture beats model selection Nutrient SDK product updates for Q1 2026 PDF redaction verification: How to prove sensitive data is permanently removed What is a VPAT? The complete guide to accessibility conformance reports What is PDF/UA? The accessible PDF standard explained Salesforce eSignatures: Generate, sign, and track documents in one flow Online document viewer: Options, tradeoffs, and how to embed one Document viewer for web apps: React, Vue, Angular (2026) Best document viewers in 2026: A buyer’s guide How to edit a PDF in Python: Add text, images, and annotations Nutrient advances Workflow platform with agentic AI for enterprise-grade speed and consistency in document-heavy operations How to create a Salesforce quote template from opportunity data The business case for accessibility: Five ways it drives enterprise value Python PDF library comparison (2026): 7 libraries for developers Why your AI agent hallucinates PDF table data PDF.js limitations: When to upgrade to a commercial PDF SDK
Announcing the TypeScript SDK for Nutrient DWS Processor API
Austin Nguyen · 2025-09-30 · via Inside Nutrient

Table of contents

    Announcing the TypeScript SDK for Nutrient DWS Processor API

    Today we’re launching the TypeScript client library for the Nutrient Document Web Services (DWS) Processor API! This SDK makes document processing integration straightforward with type safety, intelligent tooling, and workflow builder patterns.

    TL;DR

    • New TypeScript SDK provides an ergonomic interface to the Nutrient DWS Processor API
    • Type safety and IntelliSense ensure reliable development with comprehensive error handling
    • AI-native design with first-class support for popular coding assistants and Context7 integration
    • Workflow builder patterns enable chainable operations for complex document processing tasks
    • 100 percent API coverage with convenient methods and sensible defaults for common operations

    Looking to code in Python instead? Check out the Python SDK.

    Why we built this SDK

    The Nutrient DWS Processor API offers powerful document processing capabilities — converting, merging, watermarking, OCR, redaction, and digital signing. But working directly with REST APIs can be cumbersome:

    • Manual handling of multipart requests and binary data
    • No type safety or autocompletion in your IDE
    • Repetitive error handling and authentication code
    • Complex workflow orchestration for multistep operations

    Our new TypeScript SDK solves these challenges by providing:

    • Type-safe interfaces with comprehensive TypeScript definitions
    • Simplified authentication supporting both API keys and async token providers
    • Intelligent error handling with structured error types and detailed context
    • Workflow builders for chaining complex document operations
    • AI-native development with built-in support for popular coding tools

    Key features and benefits

    The TypeScript SDK is built to provide developers with a type-safe, modern, and streamlined approach to handling complex document tasks. The following sections highlight its key capabilities.

    Complete API coverage

    The TypeScript SDK provides 100 percent mapping to the Nutrient DWS Processor API with more than 35 document processing operations:

    • Document conversion — PDF, PDF/A, PDF/UA, DOCX, XLSX, PPTX, PNG, JPG, WebP, Markdown, and HTML
    • Editing operations — Watermark, rotate, flatten, redact, merge, split
    • Digital signing — PAdES standards-compliant signatures
    • Data extraction — Text, tables, key-value pairs, structured content
    • OCR processing — Multi-language image and scan recognition
    • Security features — Redaction presets, password protection, permissions
    • Optimization — Compress files without quality loss

    Type safety and developer experience

    The TypeScript SDK provides complete type definitions that give you confidence in your code:

    import { NutrientClient } from "@nutrient-sdk/dws-client-typescript";

    const client = new NutrientClient({

    apiKey: process.env.NUTRIENT_API_KEY,

    });

    // Type-safe method calls with IntelliSense.

    const result = await client.convert("document.docx", "pdf");

    const text = await client.extractText("document.pdf");

    Convenience methods with smart defaults

    While you can access the full power of the API, we’ve also provided convenience methods for common operations:

    // Simple conversion with smart defaults.

    const pdf = await client.convert("document.docx", "pdf");

    // Or customize every aspect via workflow.

    const pdf = await client

    .workflow()

    .addFilePart("document.docx")

    .outputPdfA({

    conformance: "pdfa-2b",

    optimize: {

    mrcCompression: true,

    imageOptimizationQuality: 3,

    },

    })

    .execute();

    Workflow builder pattern

    For complex document processing tasks, the SDK offers a fluent workflow builder with a staged interface that guides you through the process:

    const result = await client

    .workflow()

    // Stage 1: Combine multiple documents into one workflow.

    .addFilePart("contract.pdf")

    .addFilePart("appendix.pdf")

    // Stage 2: Apply actions — process the combined documents.

    .applyAction(

    BuildActions.watermarkText("CONFIDENTIAL", {

    opacity: 0.5,

    fontSize: 48,

    }),

    )

    .applyAction(BuildActions.createRedactionsPreset("email-address"))

    // Stage 3: Set output format — specify final document properties.

    .outputPdf({

    optimize: {

    mrcCompression: true,

    imageOptimizationQuality: 2,

    },

    })

    // Stage 4: Execute — run the entire workflow and get results.

    .execute();

    AI-native development experience

    The TypeScript SDK is designed to work in collaboration with AI coding assistants. We provide first-class support for popular AI tools, including Claude Code, GitHub Copilot, JetBrains Junie, Cursor, and Windsurf.

    After installation, run one command to download the complete package documentation directly to your AI agent’s rule sets:

    npx dws-add-claude-code-rule

    npx dws-add-github-copilot-rule

    npx dws-add-junie-rule

    npx dws-add-cursor-rule

    npx dws-add-windsurf-rule

    What this means for your development experience:

    • Improved AI assistance with comprehensive SDK documentation
    • Reduced hallucination when generating code
    • Built-in support for common questions
    • Clean integration that doesn’t interfere with other tools

    Using JetBrains Junie as an example, after installing our documentation rules, Junie could fluently generate code based on coding tasks.

    Junie generating code using the SDK after installing documentation rules

    Junie can also answer detailed questions about the package documentation, serving as a first line of support for developers.

    Junie answering questions about the SDK documentation

    Context7 MCP Server integration

    Beyond individual AI assistants, we’re also making our documentation available through Context7(opens in a new tab) — a Model Context Protocol (MCP) server that provides AI agents access to documentation for popular packages like React, Next.js, and Tailwind CSS.

    Our TypeScript package is available on Context7:

    This allows any MCP-compatible AI agent to browse and fetch our documentation on demand, providing even more flexible integration options.

    Get started today

    Before getting started, you’ll need:

    • A Nutrient DWS Processor API key
    • Node.js 18+ for TypeScript development

    Installation and basic usage

    Install via npm or yarn:

    npm install @nutrient-sdk/dws-client-typescript

    Basic usage:

    import { NutrientClient } from "@nutrient-sdk/dws-client-typescript";

    const client = new NutrientClient({

    apiKey: "your_api_key",

    });

    // Convert documents.

    const pdfResult = await client.convert("presentation.pptx", "pdf");

    // Merge multiple PDFs.

    const merged = await client.merge(["doc1.pdf", "doc2.pdf"]);

    // Add watermarks.

    const watermarked = await client.watermarkText("document.pdf", "DRAFT");

    // Extract data.

    const extractedText = await client.extractText("scanned.pdf");

    Real-world use cases

    The following sections outline some powerful workflows you can build with the TypeScript SDK.

    Document automation pipeline

    // Process contracts end to end.

    const processContract = async (contractFile: string) => {

    // Stage 1: Combine, watermark, and archive documents in a single workflow.

    const combined = await client

    .workflow()

    .addFilePart(contractFile)

    .addFilePart("terms-and-conditions.pdf")

    .applyAction(BuildActions.watermarkText("CONFIDENTIAL"))

    .outputPdfA({

    conformance: "pdfa-2b",

    optimize: { mrcCompression: true },

    })

    .execute();

    // Stage 2: Apply digital signature for legal compliance.

    const signed = await client.sign(combined.buffer, {

    signatureType: "cades",

    cadesLevel: "b-lt",

    });

    return signed;

    };

    Batch document processing

    // Extract data from multiple invoices and compile results.

    const processInvoices = async (invoiceFiles: string[]) => {

    const results = [];

    for (const invoiceFile of invoiceFiles) {

    // OCR the invoice if it's a scanned image.

    const ocrResult = await client.ocr(invoiceFile, "english");

    // Extract key-value pairs from the OCR result.

    const kvpResult = await client.extractKeyValuePairs(ocrResult.buffer);

    results.push({

    file: invoiceFile,

    data: kvpResult.data,

    });

    }

    return results;

    };

    Advanced redaction workflow

    // Multistep redaction with different strategies.

    const redactSensitiveInfo = async (document: string) => {

    return await client

    .workflow()

    .addFilePart(document)

    .applyActions([

    // Strategy 1: Target specific known content with exact text matching.

    BuildActions.createRedactionsText("Account Number: 12345"),

    // Strategy 2: Use built-in patterns for common sensitive data types.

    BuildActions.createRedactionsPreset("email-address"),

    BuildActions.createRedactionsPreset("credit-card-number"),

    // Permanently remove all marked content.

    BuildActions.applyRedactions(),

    ])

    .outputPdf()

    .execute();

    };

    We want your feedback

    This TypeScript SDK represents a significant step forward in making document processing more accessible to developers. We’d love to hear about your use cases, feature requests, and feedback:

    Try it out and let us know what you think — we’re excited to see what you’ll build!

    Explore related topics

    Try for free Ready to get started?

    Related Cloud articles

    Explore more