Skip to content

Repository files navigation

Cloudglue JavaScript SDK

NPM Version License Discord

Cloudglue makes it easy to turn video into LLM ready data. 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 @cloudglue/cloudglue-js

Quick Start

import { Cloudglue } from '@cloudglue/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/cloudglue/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

Releasing

Publishing to npm is automated: pushing a v*.*.* tag triggers a GitHub Actions workflow that builds, publishes via OIDC trusted publishing, and creates a GitHub Release with the build artifacts attached. See RELEASING.md for the exact commands, the one-time npm Trusted Publisher setup, and troubleshooting.

Contact

About

Official JavaScript / TypeScript SDK for Cloudglue API

Topics

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages