Node.js SDK
API reference for the DocuTray Node.js SDK
This is the API reference for the DocuTray Node.js SDK.
Installation
npm install docutrayQuick Start
import DocuTray from 'docutray';
const client = new DocuTray(); // uses DOCUTRAY_API_KEY env var
const result = await client.convert.run({
documentTypeCode: 'invoice',
url: 'https://example.com/invoice.pdf',
});Modules
Client
The main entry point for the SDK:
DocuTray- Client class with resource properties
Errors
Error handling classes:
Resources
API resource classes:
- Convert - Document conversion
- Identify - Document identification
- DocumentTypes - Document type catalog
- Steps - Step execution
- KnowledgeBases - Knowledge base operations
Types
Response and model types:
Get step execution status GET
Retrieves the current status and results of a step execution with standardized response format. **Status values:** - `ENQUEUED`: Request received, waiting to be processed - `PROCESSING`: Currently being processed - `SUCCESS`: Processing completed successfully - `ERROR`: Processing failed **Polling recommendation:** - Poll every 1-2 seconds for small documents - Poll every 3-5 seconds for large documents or PDFs
Client
DocuTray client class and configuration options