gitlabEdit

๐ŸŸฉNode SDK

Official JavaScript/TypeScript SDK for the Docs-Dispatcher API. Build document generation, email dispatch, SMS, invoicing, and e-signature workflows with full type safety and modern async/await patterns.

Pipeline Statusarrow-up-right Coverage Reportarrow-up-right

Features

  • ๐Ÿ“ง Email Dispatch - Send templated emails with attachments

  • ๐Ÿ“„ File Generation - Generate PDFs, DOCX, XLSX, and more from templates

  • ๐Ÿ“ฑ SMS Dispatch - Send SMS messages via multiple providers

  • ๐Ÿ“ฎ Postal Dispatch - Send physical mail

  • โœ๏ธ E-Signature - Electronic signature workflows (simple, advanced, qualified)

  • ๐Ÿงพ Invoice Generation - Create invoices, quotes, and credit notes (v0.7.0+)

  • ๐Ÿ” JWT Authentication - Modern Bearer token auth (v0.7.0+)

  • ๐Ÿ“ฆ Upload & Targets - Upload to Zoho CRM and other platforms

  • ๐ŸŽฏ TypeScript - Full type safety with IntelliSense support

  • โœ… Client-side Validation - Catch errors before API calls

Requirements

  • Node.js: ^22.0.0 (LTS recommended)

  • Package Manager: Yarn 4.8+ or npm 8+

Installation

Using npm

Quick Start

Basic Authentication

The simplest way to get started is with username/password authentication:

For production applications, use JWT Bearer tokens:

circle-info

Get Your API Token: Log in to the Docs-Dispatcher dashboardarrow-up-right and navigate to Settings โ†’ API Tokens to generate a new token.

Service Examples

Email Dispatch

Send templated emails with dynamic data:

Common Use Cases:

  • Welcome emails

  • Password reset notifications

  • Order confirmations

  • Invoice delivery

File Generation

Generate documents from templates in various formats:

Supported Formats:

  • PDF

  • DOCX (Microsoft Word)

  • XLSX (Microsoft Excel)

  • HTML

  • PNG/JPG/SVG images

See Template Managementarrow-up-right for template creation.

SMS Dispatch

Send SMS messages via configured providers:

Supported Providers:

Invoice Generation

Create invoices, quotes, or credit notes with full customization:

Invoice Providers:

  • iPaidThat: French invoicing platform

  • Qonto: European business banking

  • Stripe: Payment processing with invoicing

See Invoice Providersarrow-up-right for configuration details.

E-Signature Workflows

Request electronic signatures with configurable signature types:

Signature Types:

  • SIMPLE: Basic electronic signature

  • ADVANCED: Identity-verified signature

  • QUALIFIED: Legally binding qualified signature (eIDAS compliant)

See E-Signature Providersarrow-up-right for provider configuration.

Upload to CRM Targets

Upload generated documents to external platforms:

Supported Targets:

  • Zoho CRM

  • Universal targets (configurable endpoints)

Advanced Features

Customer Types

The SDK supports three customer types for invoicing:

Individual Customer

For B2C transactions with consumers:

Company Customer

For B2B transactions with businesses:

Freelance Customer

For transactions with freelancers/self-employed:

Document Types

Choose the appropriate document type for your use case:

Validation

The SDK includes built-in client-side validation to catch errors before making API calls:

Benefits:

  • Faster feedback (no network round-trip)

  • Detailed error paths

  • Type-safe error handling

  • Reduced API quota usage

Service Composition

Chain multiple services in a single API call:

TypeScript Support

The SDK is written in TypeScript and provides full type definitions:

Return Formats

Specify how you want the API to return generated documents:

circle-info

The actual available formats depend on your template's rendering engine. See Template Enginesarrow-up-right for details.

Error Handling

The SDK throws structured errors for different failure scenarios:

See Troubleshooting for common errors and solutions.

API Compatibility

SDK Version
API Version
Features

v0.7.0+

v3.6.2+

Bearer Auth, Invoice Dispatcher, Universal Targets

v0.6.x

v3.6.1

Partial support, BasicAuth

v0.5.x

v3.5.x

BasicAuth only, no InvoiceDispatcher

circle-exclamation

Documentation

Repository

Contributing

To contribute or run tests locally:

  1. Clone the repository

  2. Copy .env.dist to .env and configure credentials

  3. Run yarn install

  4. Run yarn test

Publishing New Versions

For maintainers:

Next Steps

Configure Providers

Troubleshoot Issues

Support

Last updated