@boldvideo/bold-js 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(pnpm run lint:*)",
5
+ "Bash(ls:*)"
6
+ ]
7
+ },
8
+ "enableAllProjectMcpServers": false
9
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @boldvideo/bold-js
2
+
3
+ ## 0.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - New `has_ai` field to settings
package/CLAUDE.md ADDED
@@ -0,0 +1,76 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ This is the Bold JavaScript SDK (`@boldvideo/bold-js`) - a TypeScript client library for interacting with the Bold Video API. The SDK provides methods for fetching videos, playlists, channel settings, and tracking analytics events.
8
+
9
+ ## Common Development Commands
10
+
11
+ ```bash
12
+ # Install dependencies
13
+ pnpm install
14
+
15
+ # Build the project (outputs to dist/)
16
+ pnpm run build
17
+
18
+ # Run type checking/linting
19
+ pnpm run lint
20
+
21
+ # Publish new version (uses changesets)
22
+ pnpm changeset
23
+ pnpm changeset version
24
+ pnpm changeset publish
25
+ ```
26
+
27
+ ## Architecture & Key Components
28
+
29
+ ### Client Structure
30
+ The SDK uses a factory pattern where `createClient(apiKey)` returns an object with namespaced methods:
31
+ - `bold.settings()` - Fetch channel settings
32
+ - `bold.videos.list()` / `.get(id)` / `.search(query)` - Video operations
33
+ - `bold.playlists.list()` / `.get(id)` - Playlist operations
34
+ - `bold.trackEvent()` / `bold.trackPageView()` - Analytics tracking
35
+
36
+ ### Core Files
37
+ - `/src/index.ts` - Main entry point, exports `createClient` and all types
38
+ - `/src/lib/client.ts` - Client factory that creates the Bold instance with API key auth
39
+ - `/src/lib/fetchers.ts` - Individual API endpoint implementations
40
+ - `/src/lib/tracking.ts` - Analytics event tracking with throttling
41
+ - `/src/lib/types.ts` - TypeScript interfaces for Video, Playlist, Settings, etc.
42
+ - `/src/util/throttle.ts` - Throttling utility for rate-limiting event tracking
43
+
44
+ ### Build Configuration
45
+ - Uses `tsup` for building TypeScript to both ESM and CommonJS formats
46
+ - Outputs to `/dist/` with type declarations
47
+ - TypeScript strict mode enabled
48
+ - Target: ES2016
49
+
50
+ ## Development Workflow
51
+
52
+ 1. The project uses GitHub Actions for CI/CD:
53
+ - All branches run lint and build checks
54
+ - Main branch can publish to npm using changesets
55
+
56
+ 2. When making changes:
57
+ - Ensure TypeScript types are properly defined
58
+ - Run `pnpm run lint` before committing
59
+ - The SDK supports both ESM and CommonJS consumers
60
+
61
+ 3. API Integration:
62
+ - Default base URL: `https://app.boldvideo.io/api/v1/`
63
+ - Authentication via API key in Authorization header
64
+ - All API methods return promises
65
+
66
+ 4. Analytics Tracking:
67
+ - Events are throttled to prevent API rate limiting
68
+ - User IDs are auto-generated for each client instance
69
+ - Debug mode available for development
70
+
71
+ ## Important Notes
72
+
73
+ - No test framework is currently configured
74
+ - The SDK is designed to be lightweight with minimal dependencies (only axios)
75
+ - All API responses follow the type definitions in `/src/lib/types.ts`
76
+ - The tracking system includes automatic throttling to handle high-frequency events like video progress updates
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <div align="center">
2
- <a href="https://wearebold.af?utm_source=github.com&utm_medium=readme&utm_campaign=bold-js" align="center">
3
- <img src="https://wearebold.af/bold-js-github-header.svg" alt="Bold Logo">
2
+ <a href="https://boldvideo.com?utm_source=github.com&utm_medium=readme&utm_campaign=bold-js" align="center">
3
+ <img src="https://boldvideo.com/bold-js-github-header.svg" alt="Bold Logo">
4
4
  </a>
5
5
  <h1 align="center rainbow">@boldvideo/bold-js</h1>
6
6
  <p align="center">
7
- The JavaScript SDK for interacting with the <a href="http://wearebold.af?utm_source=github.com&utm_medium=readme&utm_campaign=bold-js" target="_blank">Bold API</a>, to power your own business video platform.
7
+ The JavaScript SDK for interacting with the <a href="https://boldvideo.com?utm_source=github.com&utm_medium=readme&utm_campaign=bold-js" target="_blank">Bold API</a>, to power your own business video platform.
8
8
  </p>
9
9
  </div>
10
10
 
package/dist/index.d.ts CHANGED
@@ -36,6 +36,7 @@ type Settings = {
36
36
  menu_items: MenuItem[];
37
37
  ai_avatar: string;
38
38
  ai_name: string;
39
+ has_ai: boolean;
39
40
  meta_data: {
40
41
  channel_name: string;
41
42
  description: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@boldvideo/bold-js",
3
3
  "license": "MIT",
4
- "version": "0.4.2",
4
+ "version": "0.4.3",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -17,5 +17,6 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "axios": "^1.3.6"
20
- }
20
+ },
21
+ "packageManager": "pnpm@10.12.2+sha512.a32540185b964ee30bb4e979e405adc6af59226b438ee4cc19f9e8773667a66d302f5bfee60a39d3cac69e35e4b96e708a71dd002b7e9359c4112a1722ac323f"
21
22
  }
package/src/lib/types.ts CHANGED
@@ -39,6 +39,7 @@ export type Settings = {
39
39
  menu_items: MenuItem[];
40
40
  ai_avatar: string;
41
41
  ai_name: string;
42
+ has_ai: boolean;
42
43
  meta_data: {
43
44
  channel_name: string;
44
45
  description: string;