npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@divinci-ai/server

v0.1.0

Published

Divinci AI Server SDK for Node.js applications

Readme

@divinci-ai/server

Node.js SDK for full Divinci AI platform access - workspaces, releases, RAG, and more

npm version TypeScript Node.js License

Installation

npm install @divinci-ai/server
# or
pnpm add @divinci-ai/server
# or
yarn add @divinci-ai/server

Quick Start

import { DivinciServer } from "@divinci-ai/server";

const divinci = new DivinciServer({
  apiKey: process.env.DIVINCI_API_KEY,
});

// List workspaces
const workspaces = await divinci.workspaces.list();

// Create a release
const release = await divinci.releases.create({
  workspaceId: "ws_abc123",
  name: "Customer Support Bot",
  systemPrompt: "You are a helpful support agent...",
});

Features

  • Workspace Management - Create, configure, and monitor workspaces
  • Release Management - Build and deploy AI releases
  • RAG Operations - Upload documents, manage collections, search
  • API Key Management - Create and manage API keys for integrations
  • x402 Payments - Blockchain payment integration for premium features
  • TypeScript - Full type safety with comprehensive type definitions

Usage

Workspace Management

// Create a workspace
const workspace = await divinci.workspaces.create({
  name: "Customer Support",
  description: "AI-powered support assistant",
});

// Update settings
await divinci.workspaces.update(workspace._id, {
  settings: {
    defaultModel: "gpt-4o",
    maxTokens: 4096,
  },
});

// Get usage statistics
const usage = await divinci.workspaces.getUsage(workspace._id);
console.log(`Messages this month: ${usage.messagesThisMonth}`);

Release Management

// Create a release
const release = await divinci.releases.create({
  workspaceId: "ws_abc123",
  name: "Support Bot v1",
  systemPrompt: `You are a helpful support agent.
    Use the provided context to answer questions.
    If you don't know, say so.`,
  config: {
    model: "gpt-4o",
    temperature: 0.7,
    contextBubbles: true,
    helpRequests: true,
  },
});

// Get analytics
const analytics = await divinci.releases.getAnalytics(release._id, {
  startDate: new Date("2025-01-01"),
  endDate: new Date(),
});
console.log(`Total conversations: ${analytics.totalConversations}`);

RAG Document Management

import fs from "fs";

// Upload a document
const doc = await divinci.rag.uploadDocument({
  workspaceId: "ws_abc123",
  ragVectorId: "rag_xyz",
  file: fs.createReadStream("./knowledge-base.pdf"),
  metadata: { category: "support" },
});

// Wait for processing
const processed = await divinci.rag.waitForProcessing(doc._id, {
  timeout: 300000, // 5 minutes
  onProgress: (status) => console.log(`${status.progress}%`),
});

// Upload from URL
await divinci.rag.uploadDocument({
  workspaceId: "ws_abc123",
  ragVectorId: "rag_xyz",
  url: "https://docs.example.com/faq",
});

// Search the collection
const results = await divinci.rag.search({
  workspaceId: "ws_abc123",
  ragVectorId: "rag_xyz",
  query: "return policy",
  limit: 5,
});

API Key Management

// Create an API key
const apiKey = await divinci.apiKeys.create({
  workspaceId: "ws_abc123",
  name: "Production Key",
  permissions: ["chat:read", "chat:write", "rag:read"],
  allowedOrigins: ["https://myapp.com"],
  rateLimit: {
    requestsPerMinute: 100,
    requestsPerDay: 10000,
  },
});

console.log("API Key:", apiKey.secretKey); // Only shown once!

// Validate a key
const validation = await divinci.apiKeys.validate(apiKey.secretKey);
console.log(`Valid: ${validation.valid}`);
console.log(`Permissions: ${validation.permissions.join(", ")}`);

x402 Payment Integration

import { createX402Wallet } from "@divinci-ai/server";

// Create a wallet for payments
const wallet = createX402Wallet({
  privateKey: process.env.WALLET_PRIVATE_KEY,
  network: "base", // or "base-sepolia" for testing
});

// Configure x402 on the client
const divinci = new DivinciServer({
  apiKey: process.env.DIVINCI_API_KEY,
  x402: {
    wallet,
    autoPayment: true,
    maxPaymentUsd: 1.0,
  },
});

// Use x402 client for payment operations
const pricing = await divinci.x402.listPricing();
const history = await divinci.x402.getPaymentHistory({ limit: 10 });
const balance = await divinci.x402.getWalletBalance();

Configuration

const divinci = new DivinciServer({
  // Required
  apiKey: process.env.DIVINCI_API_KEY,

  // Optional
  baseUrl: "https://api.divinci.app",
  timeout: 30000,
  maxRetries: 3,

  // x402 Payment Configuration
  x402: {
    wallet: createX402Wallet({ privateKey: "0x..." }),
    autoPayment: true,
    maxPaymentUsd: 5.0,
    network: "base",
  },
});

API Reference

DivinciServer

| Property | Description | |----------|-------------| | workspaces | Workspace management client | | releases | Release management client | | rag | RAG document and search client | | apiKeys | API key management client | | x402 | x402 payment client |

WorkspaceClient

| Method | Description | |--------|-------------| | create(options) | Create a new workspace | | get(id) | Get workspace by ID | | list(options?) | List all workspaces | | update(id, options) | Update workspace settings | | delete(id) | Delete a workspace | | getUsage(id) | Get usage statistics |

ReleaseClient

| Method | Description | |--------|-------------| | create(options) | Create a new release | | get(id) | Get release by ID | | list(options?) | List releases for workspace | | update(id, options) | Update release configuration | | publish(id) | Publish a release | | getAnalytics(id, options?) | Get release analytics |

RagClient

| Method | Description | |--------|-------------| | uploadDocument(options) | Upload a document | | waitForProcessing(docId, options?) | Wait for document processing | | listDocuments(options) | List documents in collection | | deleteDocument(docId) | Delete a document | | search(options) | Search documents | | getDocument(docId) | Get document details |

ApiKeyClient

| Method | Description | |--------|-------------| | create(options) | Create a new API key | | get(id) | Get API key by ID | | list(options?) | List API keys | | update(id, options) | Update API key settings | | revoke(id) | Revoke an API key | | validate(secretKey) | Validate an API key | | getUsage(id) | Get API key usage stats |

X402Client

| Method | Description | |--------|-------------| | listPricing() | Get tool pricing information | | getPaymentHistory(options?) | Get payment history | | verifyPayment(txHash) | Verify a payment transaction | | getWalletBalance() | Get wallet balance |

Environment Variables

| Variable | Description | Required | |----------|-------------|----------| | DIVINCI_API_KEY | API key for authentication | Yes | | WALLET_PRIVATE_KEY | Wallet key for x402 payments | For x402 |

Related Packages

Documentation

Full documentation available at sdk.divinci.app

License

MIT