๐ฆSDK Overview
Docs-Dispatcher provides official client libraries in three popular programming languages to simplify integration with the API. These SDKs handle authentication, request building, validation, and error handling, allowing you to focus on your business logic.
Why Use an SDK?
While you can interact with the Docs-Dispatcher API using raw HTTP clients or curl, SDKs provide significant advantages:
Type Safety
Strong typing: Full IntelliSense and autocomplete support in your IDE
Compile-time checks: Catch errors before runtime
TypeScript support: The Node.js SDK includes complete TypeScript definitions
Developer Experience
Simplified authentication: Built-in support for Bearer tokens and Basic Auth
Intuitive builders: Chain methods to construct complex objects (invoices, customers, items)
Validation: Client-side validation catches errors before making API calls
Error handling: Structured exceptions with detailed error information
Maintainability
Version compatibility: SDKs are versioned alongside the API
Backward compatibility: Clear upgrade paths when API changes
Documentation: Inline documentation and code examples
Productivity
Less boilerplate: No need to manually construct JSON payloads
Helper utilities: Built-in formatters, converters, and validators
Service composition: Easily combine multiple services (e.g., generate + email + upload)
Available SDKs
Feature Comparison
Authentication
Bearer Token (JWT)
โ v0.7.0+
โ v0.2+
โ
Basic Auth
โ
โ
โ
Services
Email Dispatch
โ
โ
โ
File Generation
โ
โ
โ
SMS Dispatch
โ
โ
โ
Postal Dispatch
โ
โ
โ
E-Signature
โ
โ
โ
Invoicing
โ v0.7.0+
โ
โ
Upload Targets
โ
โ
โ
Service Composition
โ
โ
โ
Developer Experience
TypeScript Support
โ Full types
โ
โ
Builder Pattern
โ
โ ๏ธ Partial
โ ๏ธ Partial
Validation
โ Client-side
โ ๏ธ Server-side
โ ๏ธ Server-side
Async/Promises
โ async/await
โ
โ
Documentation
Inline Docs
โ
โ
โ
Code Examples
โ
โ
โ
Online API Docs
โ
โ
โ ๏ธ JavaDoc
SDK Selection Guide
Choose Node.js SDK if you:
Use JavaScript or TypeScript in your stack
Want the best developer experience with full type safety
Need client-side validation before API calls
Prefer modern async/await patterns
Use Yarn or npm package management
Build web applications, serverless functions, or Node.js backends
Best for: Modern JavaScript/TypeScript applications, React/Vue/Angular frontends, serverless environments
Get Started with Node.js SDK โ
Choose PHP SDK if you:
Use PHP 8.1+ in your backend
Build traditional server-side applications
Use Composer for dependency management
Need a mature, stable PHP ecosystem
Integrate with frameworks like Laravel, Symfony, or WordPress
Best for: PHP web applications, CMS integrations, traditional server-rendered websites
Choose Java SDK if you:
Use Java 1.8+ or Kotlin
Build enterprise applications
Use Maven or Gradle for dependency management
Need thread-safe client libraries
Work with Spring Boot, Jakarta EE, or other Java frameworks
Require strong compile-time safety
Best for: Enterprise Java applications, Android apps, microservices, Spring Boot projects
API Compatibility
All SDKs are designed to work with Docs-Dispatcher API v3.6+. Feature availability depends on both SDK version and API version:
Basic Auth
v3.5+
All
All
All
Bearer Token (JWT)
v3.6+
v0.7.0+
v0.2+
All
Invoice Dispatcher
v3.6.2+
v0.7.0+
v0.2+
All
Universal Targets
v3.6.2+
v0.7.0+
v0.2+
All
E-Invoice Support
v3.7+
v0.7.0+
v0.2+
All
Legacy Support: If you're using API v3.5.x or earlier, you'll need to use Basic Auth and won't have access to the Invoice Dispatcher or Universal Targets features.
Common Workflows
1. Simple Document Generation
Generate a PDF from a template with data:
Node.js:
FileDispatcher+setTemplateName()+dispatch()PHP:
FileService+ServiceMediator+Client::executeRequest()Java:
FileContentRequest+EndUserApiApi::dispatchersDispatch()
2. Email with Generated Attachment
Generate a document and send it via email in one API call:
All SDKs: Use service composition to chain
FILE+EMAIL
3. Invoice Creation and Delivery
Create an invoice and have the provider send it:
Node.js:
InvoiceDispatcherwith builder patternPHP:
InvoicingServicewith customer and itemsJava: Build
CompositeRequestwith invoice data
4. Multi-Provider Dispatch
Send the same document via multiple channels:
All SDKs: Chain services like
FILE+EMAIL+SMS+UPLOAD
Authentication Best Practices
Recommendation: Always use Bearer Token (JWT) authentication for production applications. It's more secure and provides better audit trails.
Obtaining API Tokens
Log in to your Docs-Dispatcher dashboard
Navigate to Settings โ API Tokens
Generate a new token with appropriate permissions
Store the token securely (environment variables, secrets manager)
Security Guidelines
Never commit tokens to version control
Use environment variables for token storage
Rotate tokens regularly (quarterly or after team changes)
Use separate tokens for development, staging, and production
Implement token expiration and renewal logic
Log authentication failures for security monitoring
See Authentication Guide for detailed information.
Next Steps
Learn from Examples
Understand Services
Troubleshoot Issues
API Reference
Community and Support
GitLab Issues: Report bugs or request features in each SDK's repository
Documentation: https://docs-dispatcher.io/docs
Email Support: [email protected]
API Status: Monitor at status.docs-dispatcher.io
Migration Guides
Upgrading from an older SDK version? See the CHANGELOG in each SDK repository:
Last updated