Client SDK Overview
Client SDK
The @divinci-ai/client package provides a browser-compatible SDK for building custom chat interfaces.
Features
- Headless chat integration
- Real-time streaming responses
- Event-driven architecture
- TypeScript support
- Lightweight bundle size
Installation
npm install @divinci-ai/clientBasic Usage
import { DivinciClient } from "@divinci-ai/client";
const client = new DivinciClient({ releaseId: "rel_your-release-id", apiKey: "divinci_key_...",});
// Send a messageconst response = await client.chat.send("Hello!");console.log(response.content);Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
releaseId | string | Yes | Your release ID |
apiKey | string | No* | API key for authentication |
getToken | () => Promise<string> | No* | Function to get JWT token |
externalUser | ExternalUser | No | User identification for embed |
baseUrl | string | No | Override API base URL |
*Either apiKey or getToken is required.