Docuvate SDKs
Official clients for scripts and integrations. The contract and codegen follow the OpenAPI document exported from your instance.
Your instance serves the OpenAPI description at GET /v1/openapi.json, matching the interactive API reference.
After API changes in your self-hosted setup: export OpenAPI and regenerate SDKs (pnpm openapi:export, pnpm sdk:codegen).
Set up service access
Scripts and integrations use a service API key. The key is bound to a user and can carry document permissions.
- Set
DOCUVATE_SERVICE_API_KEYSin.envas a JSON array (keyId, secret, tenantUserId, claims). - Call the API at
https://your-host/v1. - Send the secret as
Authorization: Bearer <secret>orX-Docuvate-Api-Key.
Node.js and TypeScript
Install Node.js SDK
Install @docuvate/sdk from the public Git repository:
pnpm add "@docuvate/sdk@github:Docuvate/docuvate#path:packages/sdk-node"DocuvateClient with baseUrl and apiKey (service API key). Configure keys in the Service access section on this page.
import { DocuvateClient } from '@docuvate/sdk';
const client = new DocuvateClient({
baseUrl: 'https://your-host/v1',
apiKey: process.env.DOCUVATE_API_KEY,
});
const { data, error } = await client.api.listDocuments({
query: { q: 'lease agreement', status: 'ready' },
});
if (error) throw error;
for (const doc of data.items) {
console.log(doc.title, doc.documentDate);
}await client.api.createTag({ body: { name: 'Inbox' } });const reply = await client.api.chat({
path: { id: documentId },
body: { message: 'What due date is mentioned?' },
});
if (reply.error) throw reply.error;
console.log(reply.data.reply.content);Flutter
Install Flutter SDK
Add the Git dependency in pubspec.yaml and run flutter pub get:
dependencies:
docuvate:
git:
url: https://github.com/Docuvate/docuvate.git
path: packages/sdk-flutterDocuvateClientConfig with baseUrl and apiKey for headless access.
final client = DocuvateClient(
DocuvateClientConfig(
baseUrl: 'https://your-host/v1',
apiKey: apiKey,
),
);
await client.documents.createDocument(/* MultipartFile */);final tags = await client.taxonomy.listTags();
print(tags.data?.items);final response = await client.documents.chat(
id: documentId,
documentChatRequestDto: DocumentChatRequestDto(
message: 'What due date is mentioned?',
),
);
print(response.data?.reply.content);