Skip to main content

Installation

The Jabrod SDK is available on npm and works with Node.js and browser environments.

Requirements

  • Node.js 18+ or browser with ES2020 support
  • TypeScript 4.7+ (optional but recommended)

Install

npm install jabrod

Initialize

import { JabrodClient } from 'jabrod';

const jabrod = new JabrodClient({
  apiKey: process.env.JABROD_API_KEY
});

Configuration Options

OptionTypeRequiredDescription
apiKeystringYesYour Jabrod API key (starts with jb_)
baseUrlstringNoCustom API base URL (default: cloud.jabrod.com)

TypeScript Support

The SDK includes full TypeScript support with exported types:
import type {
  KnowledgeBase,
  Document,
  ChatResult,
  QueryResult,
  UsageStats
} from 'jabrod';

Error Handling

import { JabrodClient, JabrodError } from 'jabrod';

try {
  const result = await jabrod.rag.query({ ... });
} catch (error) {
  if (error instanceof JabrodError) {
    console.log(error.code);    // 'INVALID_API_KEY', etc.
    console.log(error.message);
    console.log(error.status);
  }
}

Next Steps