DocuProx Node.js SDK
A Node.js library for processing files using the Docuprox API. This package provides a simple and reliable way to send files or base64-encoded data for automated document processing and extraction.
Installation
Install the DocuProx package using npm or yarn:
Using npm
npm install docuprox
Using yarn
yarn add docuprox
Setup
Create a .env file in the root directory with your Docuprox API
credentials:
DOCUPROX_API_URL=https://api.docuprox.com/v1
DOCUPROX_API_KEY=your-api-key-here
Note: You must provide your own API key. The default in the code is only a placeholder and should not be used in production.
Quick Start
Get started with DocuProx in just a few lines of code:
const Docuprox = require("docuprox");
// Initialize client (uses .env variables by default)
const docuprox = new Docuprox();
(async () => {
try {
// Process a file
const fileResult = await docuprox.processFile("./sample.jpg", "your-template-uuid");
console.log("File Result:", fileResult);
// Process base64 data
const base64Result = await docuprox.processBase64("base64-string", "your-template-uuid");
console.log("Base64 Result:", base64Result);
} catch (error) {
console.error("Error:", error.message);
}
})();
API Reference
Docuprox Class
Constructor
new Docuprox(apiUrl?, apiKey?)
- apiUrl: Optional base URL (defaults to env or https://api.docuprox.com/v1)
- apiKey: Optional API key (defaults to env or placeholder)
Methods
processFile(filePath, templateId)
Processes a file by uploading it to the API.
- filePath: Path to the file
- templateId: Template UUID
- Returns: Promise containing API response
processBase64(base64Data, templateId)
Processes base64 encoded data.
- base64Data: Base64 string
- templateId: Template UUID
- Returns: Promise containing API response
Dependencies
- axios: ^1.11.0
- dotenv: ^17.2.1
Key Features
Simple API
Easy to integrate with minimal configuration
Supports Multiple Formats
Upload files directly or send base64 data
Promise-based
Modern async/await support for clean code
Reliable Error Handling
Clear error messages and structured responses