Requirements
Node.js 18 or later
TypeScript 5.0+ (recommended)
pnpm, npm, or yarn
Quick Install
Install the core packages for document extraction:@doclo/flows- Flow builder and all processing nodes@doclo/providers-llm- LLM/VLM provider integrations
Package Overview
The SDK is modular. Install only what you need:Core Packages
| Package | Description | Install |
|---|---|---|
@doclo/flows | Flow builder, nodes, orchestration | Required |
@doclo/providers-llm | OpenAI, Anthropic, Google, xAI | Required |
@doclo/core | Types, utilities (auto-installed) | - |
Optional Packages
| Package | Description | When to use |
|---|---|---|
@doclo/providers-datalab | Surya, Marker OCR | OCR-first pipelines |
@doclo/providers-reducto | Reducto parsing/splitting | Document splitting |
@doclo/schemas | Pre-built schemas | Common document types |
@doclo/client | Cloud API client | Using Doclo Cloud |
Install by Use Case
- Basic Extraction
- OCR + Extraction
- Cloud Client
- Full SDK
For simple document extraction using VLM:
TypeScript Setup
The SDK is written in TypeScript and includes type definitions. No additional@types packages needed.
tsconfig.json
Recommended settings:Running TypeScript
Usetsx for running TypeScript files directly:
Environment Variables
Create a.env.local file for API keys:
Loading Environment Variables
- Node.js
- Next.js
Install dotenv:Import at the top of your script:
Verify Installation
Create a test file to verify everything works:Troubleshooting
Cannot find module '@doclo/flows'
Cannot find module '@doclo/flows'
Make sure you’re in your project directory and packages are installed:
TypeScript errors
TypeScript errors
Ensure your
tsconfig.json has:ESM/CJS issues
ESM/CJS issues
The SDK uses ESM. If you see “require is not defined”, ensure your
package.json has: