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.

  1. Set DOCUVATE_SERVICE_API_KEYS in .env as a JSON array (keyId, secret, tenantUserId, claims).
  2. Call the API at https://your-host/v1.
  3. Send the secret as Authorization: Bearer <secret> or X-Docuvate-Api-Key.

Node.js and TypeScript

Install Node.js SDK

Install @docuvate/sdk from the public Git repository:

Terminal
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.

Search documents
src/docuvate.ts
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);
}
Create a label
src/docuvate.ts
await client.api.createTag({ body: { name: 'Inbox' } });
Ask in chat
src/docuvate.ts
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:

pubspec.yaml
dependencies:
  docuvate:
    git:
      url: https://github.com/Docuvate/docuvate.git
      path: packages/sdk-flutter

DocuvateClientConfig with baseUrl and apiKey for headless access.

Upload a document
lib/docuvate_client.dart
final client = DocuvateClient(
  DocuvateClientConfig(
    baseUrl: 'https://your-host/v1',
    apiKey: apiKey,
  ),
);
await client.documents.createDocument(/* MultipartFile */);
List labels
lib/docuvate_client.dart
final tags = await client.taxonomy.listTags();
print(tags.data?.items);
Ask in chat
lib/docuvate_client.dart
final response = await client.documents.chat(
  id: documentId,
  documentChatRequestDto: DocumentChatRequestDto(
    message: 'What due date is mentioned?',
  ),
);
print(response.data?.reply.content);