๐ฉ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.
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 Yarn (Recommended)
Using npm
Quick Start
Basic Authentication
The simplest way to get started is with username/password authentication:
Bearer Token Authentication (Recommended)
For production applications, use JWT Bearer tokens:
Get Your API Token: Log in to the Docs-Dispatcher dashboard 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 Management for template creation.
SMS Dispatch
Send SMS messages via configured providers:
Supported Providers:
SMS Factor
Twilio
AWS SNS
Others (see SMS 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 Providers 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 Providers 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:
The actual available formats depend on your template's rendering engine. See Template Engines for details.
Error Handling
The SDK throws structured errors for different failure scenarios:
See Troubleshooting for common errors and solutions.
API Compatibility
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
Upgrade Recommendation: If you're using API v3.5.x or earlier, consider upgrading to v3.6.2+ to access the full feature set including Bearer Auth and Invoice Dispatcher.
Documentation
Online API Documentation: https://docs-dispatcher-io.gitlab.io/docs-dispatcher-clients/docsdispatcher-js-client/doc/
API Specification: https://api.docs-dispatcher.io/docs
Swagger UI: https://api.docs-dispatcher.io/docs/swagger
CHANGELOG: View on GitLab
Repository
Pipeline:
Coverage:
Contributing
To contribute or run tests locally:
Clone the repository
Copy
.env.distto.envand configure credentialsRun
yarn installRun
yarn test
Publishing New Versions
For maintainers:
Next Steps
Learn from Examples
Configure Providers
Troubleshoot Issues
Manage Templates
Support
Issues: GitLab Issues
Email: [email protected]
Documentation: https://docs-dispatcher.io/docs
Last updated