Official SDKs for integrating Divinci AI into your applications
| Package | Description | npm |
|---|---|---|
@divinci-ai/cli |
Official CLI for managing workspaces, chat, RAG, and releases | |
@divinci-ai/client |
Browser SDK for headless chat integration | |
@divinci-ai/server |
Node.js SDK for full platform access | |
@divinci-ai/mcp |
MCP protocol SDK for AI assistants | |
@divinci-ai/types |
Shared TypeScript type definitions | |
@divinci-ai/embed-chat-ui |
Framework-agnostic embeddable chat widget for a Divinci Release | |
@divinci-ai/extension-bridge |
Talk to the Divinci Local Inference browser extension, with cloud fallback | |
@divinci-ai/robot-avatar |
The Divinci robot mascot as a react-three-fiber component | |
@divinci-ai/trustbench-verifier |
Verify signed TrustBench benchmark run manifests (browser, Node, Workers, Deno) |
Also here: the documentation site behind sdk.divinci.ai, examples, and the divinci agent skill.
import { DivinciClient } from "@divinci-ai/client";
const client = new DivinciClient({
releaseId: "rel_your-release-id",
apiKey: "divinci_key_...",
});
// Simple message
const response = await client.chat.send("What is machine learning?");
console.log(response.content);
// Streaming
for await (const chunk of client.chat.stream("Tell me a story")) {
process.stdout.write(chunk.content);
}import { DivinciServer } from "@divinci-ai/server";
const divinci = new DivinciServer({
apiKey: process.env.DIVINCI_API_KEY,
});
// Manage workspaces
const workspace = await divinci.workspaces.create({
name: "My AI Assistant",
});
// Upload documents to RAG
await divinci.rag.uploadDocument({
workspaceId: workspace._id,
ragVectorId: "rag_xyz",
file: fs.createReadStream("./knowledge.pdf"),
});
// Create and publish a release
const release = await divinci.releases.create({
workspaceId: workspace._id,
name: "Support Bot v1",
systemPrompt: "You are a helpful assistant...",
});import { McpClient } from "@divinci-ai/mcp";
const client = new McpClient({
serverUrl: "https://mcp.divinci.app",
apiKey: "divinci_key_...",
});
await client.connect();
// List available tools
const tools = await client.listTools();
// Call a tool
const result = await client.callTool("search_knowledge", {
query: "return policy",
});| Use Case | SDK | Example |
|---|---|---|
| Terminal chat & management | @divinci-ai/cli |
divinci chat, divinci rag search |
| Chat widget in browser | @divinci-ai/client |
React app, Vue app |
| Custom chat UI | @divinci-ai/client |
Headless chat integration |
| Backend API integration | @divinci-ai/server |
Express, Fastify, NestJS |
| RAG document management | @divinci-ai/server |
Document upload, search |
| Workspace administration | @divinci-ai/server |
Create workspaces, releases |
| Claude Desktop integration | @divinci-ai/mcp |
MCP tool access |
| Cursor AI integration | @divinci-ai/mcp |
MCP tool access |
| x402 payment handling | @divinci-ai/mcp or @divinci-ai/server |
Premium tool payments |
| Feature | CLI | Client | Server | MCP |
|---|---|---|---|---|
| Environment | Terminal | Browser | Node.js | Both |
| Chat Messages | Yes | Yes | - | Yes |
| Streaming | Yes | Yes | Yes | - |
| Workspace Management | Yes | - | Yes | - |
| Release Management | Yes | - | Yes | - |
| RAG Operations | Yes | - | Yes | Yes |
| API Key Management | - | - | Yes | - |
| x402 Payments | - | - | Yes | Yes |
| Auth0 PKCE | - | Yes | - | Yes |
| MCP Protocol | - | - | - | Yes |
| Raw API Access | Yes | - | Yes | - |
# CLI (global install)
npm install -g @divinci-ai/cli
# Browser SDK
npm install @divinci-ai/client
# Server SDK
npm install @divinci-ai/server
# MCP SDK
npm install @divinci-ai/mcpconst divinci = new DivinciServer({
apiKey: process.env.DIVINCI_API_KEY,
});const client = new DivinciClient({
releaseId: "rel_abc123",
apiKey: "divinci_key_...",
externalUser: {
id: "user_123",
email: "user@example.com",
tier: "premium",
},
});const client = new DivinciClient({
releaseId: "rel_abc123",
getToken: async () => {
const res = await fetch("/api/divinci-token");
return res.json().token;
},
});- Node.js >= 18.0.0
- pnpm >= 8.0.0
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Run tests with coverage
pnpm test:coverage├── packages/ # the nine @divinci-ai/* npm packages
├── docs/ # sdk.divinci.ai (Astro + Starlight)
├── examples/ # runnable examples
├── skills/divinci/ # agent skill for Claude Code and other agents
├── templates/ # starter templates
└── tests/integration/ # contract tests against a live API (needs credentials)
Full documentation available at sdk.divinci.ai
examples/cloudflare-worker-embed-anonymous— embed chat for anonymous visitors from a Cloudflare Workerexamples/cloudflare-worker-embed-auth— the same, for signed-in users- Landing-page template — Astro + Cloudflare Worker marketing page, re-skinnable via one
brand.config.ts
More code samples live in the documentation.
- Divinci Platform - Main platform
- Embed Script - Drop-in chat widget
- API Documentation - REST API reference
Issues and pull requests are welcome here. This repository is published from Divinci's internal monorepo: a maintainer applies an accepted pull request there, and the next sync brings it back here with your authorship credited. See CONTRIBUTING.md.
MIT - see LICENSE for details.