Docuvate SDKs
Offizielle Node- und Flutter-Clients für die Headless-API /v1. Vertrag und Codegenerierung basieren auf der exportierten OpenAPI: openapi/docuvate.v1.json
Laufzeit: GET /v1/openapi.json (dieselbe Beschreibung).
Nach API-Änderungen: pnpm openapi:export, dann pnpm sdk:codegen (siehe docs/sdks.md). ( docs/sdks.md in the repository.)
Service-Zugang einrichten
Für Skripte und Integrationen legen Sie einen Service-API-Schlüssel an. Der Schlüssel ist an einen Benutzer gebunden und kann Berechtigungen für Dokumente tragen.
- In
.envdie VariableDOCUVATE_SERVICE_API_KEYSals JSON-Array setzen (keyId, secret, tenantUserId, claims). - API unter
https://ihr-host/v1ansprechen. - Schlüssel im Header
Authorization: Bearer <secret>oderX-Docuvate-Api-Keysenden.
Node / TypeScript (@docuvate/sdk)
pnpm add @docuvate/sdk
DocuvateClient mit baseUrl und apiKey (Service-API-Schlüssel). Details: docs/sdks.md und packages/sdk-node/README.md.
import { DocuvateClient } from '@docuvate/sdk';
const client = new DocuvateClient({
baseUrl: 'https://ihr-host/v1',
apiKey: process.env.DOCUVATE_API_KEY,
});
const list = await client.api.listDocuments({ query: { status: 'ready' } });await client.api.createTag({ body: { name: 'Eingang' } });const reply = await client.api.chat({
path: { id: documentId },
body: { message: 'Welche Fälligkeit ist genannt?' },
});
console.log(reply.data?.reply?.content);Flutter (docuvate)
docuvate: ^1.0.0 in pubspec.yaml (Monorepo-Pfad packages/sdk-flutter)
DocuvateClientConfig mit baseUrl und apiKey für Headless-Zugriff.
final client = DocuvateClient(
DocuvateClientConfig(
baseUrl: 'https://ihr-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: 'Welche Fälligkeit ist genannt?',
),
);
print(response.data?.reply.content);