Official JavaScript SDK for the CloudGlue API.
By using this SDK, you agree to the CloudGlue Terms of Service and acknowledge our Privacy Policy.
npm install @aviaryhq/cloudglue-js
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
});
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
}
- Node.js 16+
- npm or yarn
- Git (for spec submodule)
- Clone the repository:
git clone https://github.com/aviaryhq/cloudglue-js.git
cd cloudglue-js
- Initialize the spec submodule:
make submodule-init
- Install dependencies:
npm install
- Generate API clients:
npm run generate
make submodule-init
: Initialize the OpenAPI spec submodulemake submodule-update
: Update the OpenAPI spec submodulenpm run generate
: Generate API clients from the specnpm run build
: Build the packagenpm run clean
: Clean build artifactsnpm run prepare
: Build the package (used by npm)npm run watch
: Watch for changes and rebuild automatically (development)
npm run build
This will:
- Clean the previous build
- Compile TypeScript files