Bold VideoDocs

SDK Overview

@boldvideo/bold-js: the typed JavaScript client for the Bold API

@boldvideo/bold-js is Bold's official TypeScript/JavaScript SDK. It wraps the REST API with typed methods, handles SSE streaming for AI features, and works in Node.js and the browser. Keep your API key server-side (see Authentication).

Installation

npm install @boldvideo/bold-js

Quick start

import { createClient } from '@boldvideo/bold-js';

const bold = createClient(process.env.BOLD_API_KEY!);

// Fetch videos
const { data: videos } = await bold.videos.list();

// Stream an AI answer
const stream = await bold.ai.chat({ prompt: 'What videos cover pricing?' });
for await (const event of stream) {
  if (event.type === 'text_delta') process.stdout.write(event.delta);
}

Get your API key under Settings → Developer. The key dialog can generate this exact snippet for you.

Client options

const bold = createClient('your-api-key', {
  baseURL: 'https://custom-endpoint.example.com', // optional
  debug: true,                                    // optional
  headers: { 'X-Custom': 'value' }                // optional
});
OptionTypeDescription
baseURLstringCustom API endpoint
debugbooleanEnable debug logging
headersRecord<string, string>Additional HTTP headers

What's in the box

Response conventions

  • All responses are camelCase (video.playbackId, not playback_id)
  • Resource methods return a { data } envelope: const { data: videos } = await bold.videos.list()
  • AI methods return an async-iterable stream by default; pass stream: false for plain JSON

Rather start from a working app?

The Next.js starter is a complete video portal built on this SDK (player, search, AI chat, dark mode), deployable in minutes.

On this page