Skip to content

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

Terminal window
npm install @divinci-ai/client

Basic Usage

import { DivinciClient } from "@divinci-ai/client";
const client = new DivinciClient({
releaseId: "rel_your-release-id",
apiKey: "divinci_key_...",
});
// Send a message
const response = await client.chat.send("Hello!");
console.log(response.content);

Configuration Options

OptionTypeRequiredDescription
releaseIdstringYesYour release ID
apiKeystringNo*API key for authentication
getToken() => Promise<string>No*Function to get JWT token
externalUserExternalUserNoUser identification for embed
baseUrlstringNoOverride API base URL

*Either apiKey or getToken is required.

Next Steps

  • Chat - Send and receive messages
  • Streaming - Handle streaming responses
  • Events - Subscribe to events