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-jsQuick 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
});| Option | Type | Description |
|---|---|---|
baseURL | string | Custom API endpoint |
debug | boolean | Enable debug logging |
headers | Record<string, string> | Additional HTTP headers |
What's in the box
Videos
List, fetch, and search videos
Playlists
Curated playlists with videos
Viewers & Progress
Members, lookup, and watch progress
AI Methods
Chat, search, recommendations
Streaming
Handle SSE events
Community
Posts, comments, reactions
Session Management
Device limits & password-sharing prevention
Analytics
Report playback from custom players
Response conventions
- All responses are camelCase (
video.playbackId, notplayback_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: falsefor 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.