Skip to content

Official JavaScript / TypeScript SDK for CloudGlue API

License

Notifications You must be signed in to change notification settings

aviaryhq/cloudglue-js

Repository files navigation

CloudGlue JavaScript SDK

Official JavaScript SDK for the CloudGlue API.

📖 Resources

By using this SDK, you agree to the CloudGlue Terms of Service and acknowledge our Privacy Policy.

Installation

npm install @aviaryhq/cloudglue-js

Quick Start

import { CloudGlue } from '@aviaryhq/cloudglue-js';

// Initialize the client
const client = new CloudGlue({
  apiKey: process.env.CLOUDGLUE_API_KEY
});

// List your video files
const response = await client.files.listFiles({ limit: 10 });

// Chat with a collection
const chatResponse = await client.chat.createCompletion({
  model: 'nimbus-001',
  messages: [
    { role: 'user', content: 'What are the key points discussed in these videos?' }
  ],
  // Assumes collection already exists, otherwise create one first then reference here by collection id 
  collections: ['your_collection_id'],
  include_citations: true,
  force_search: true
});

Configuration

The CloudGlue client accepts the following configuration options:

interface CloudGlueConfig {
  apiKey?: string;      // Your API key (can also use CLOUDGLUE_API_KEY env var)
  baseUrl?: string;     // Optional custom base URL
}

Development

Prerequisites

  • Node.js 16+
  • npm or yarn
  • Git (for spec submodule)

Setup

  1. Clone the repository:
git clone https://github.com/aviaryhq/cloudglue-js.git
cd cloudglue-js
  1. Initialize the spec submodule:
make submodule-init
  1. Install dependencies:
npm install
  1. Generate API clients:
npm run generate

Available Commands

  • make submodule-init: Initialize the OpenAPI spec submodule
  • make submodule-update: Update the OpenAPI spec submodule
  • npm run generate: Generate API clients from the spec
  • npm run build: Build the package
  • npm run clean: Clean build artifacts
  • npm run prepare: Build the package (used by npm)
  • npm run watch: Watch for changes and rebuild automatically (development)

Building

npm run build

This will:

  1. Clean the previous build
  2. Compile TypeScript files

Contact