@heybello/bello-sdk 0.1.0 → 0.2.0

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.
package/README.md CHANGED
@@ -1,64 +1,53 @@
1
1
  # Bello SDK
2
2
 
3
- Embed voice agents into any website in minutes.
4
-
5
- ## Overview
6
-
7
- Bello SDK is a lightweight JavaScript library that enables you to integrate conversational voice agents into your web applications quickly and easily. Transform your website's user experience with natural voice interactions.
8
-
9
- **Supports multiple platforms:** HTML/JS, React, WordPress, and Shopify.
10
-
11
- ## Features
12
-
13
- - **Multi-Platform Support** - Works with vanilla JS, React, WordPress, and Shopify
14
- - **Quick Integration** - Get started in minutes with minimal setup
15
- - **Voice-First Experience** - Natural conversation with your users
16
- - **Cross-Browser Support** - Works across all modern browsers
17
- - **Customizable UI** - Adapt the interface to match your brand
18
- - **Real-time Voice Processing** - Low-latency voice recognition and synthesis
19
- - **Event-Driven Architecture** - React to conversation events in your application
3
+ Embed AI voice agents into any website in minutes.
20
4
 
21
5
  ## Install
22
6
 
23
7
  ```bash
24
- pnpm add @heybello/bello-sdk
25
- # or
26
8
  npm install @heybello/bello-sdk
27
9
  ```
28
10
 
29
- ## CDN / HTML usage
11
+ ## HTML / Script Tag
12
+
13
+ Add this before the closing `</body>` tag:
30
14
 
31
15
  ```html
32
16
  <script
33
17
  src="https://unpkg.com/@heybello/bello-sdk@latest/dist/bello-embed.iife.js"
34
18
  defer
35
19
  data-project-id="YOUR_PROJECT_ID"
36
- data-api-base-url="https://your-api.example.com"
37
- data-position="bottom-right"
38
- data-theme="dark"
39
- data-orb-style="galaxy"
20
+ data-widget-api-key="YOUR_WIDGET_API_KEY"
40
21
  ></script>
41
22
  ```
42
23
 
43
- You can also initialize manually:
24
+ The widget automatically loads your project's configuration (theme, colors, titles, voice) from the Bello dashboard.
25
+
26
+ ### Optional overrides
27
+
28
+ Override dashboard settings with data attributes:
44
29
 
45
30
  ```html
46
- <script>
47
- window.Bello = window.Bello || [];
48
- window.Bello.push([
49
- 'init',
50
- {
51
- projectId: 'YOUR_PROJECT_ID',
52
- apiBaseUrl: 'https://your-api.example.com',
53
- position: 'bottom-right',
54
- theme: 'dark',
55
- orbStyle: 'galaxy'
56
- }
57
- ]);
58
- </script>
31
+ <script
32
+ src="https://unpkg.com/@heybello/bello-sdk@latest/dist/bello-embed.iife.js"
33
+ defer
34
+ data-project-id="YOUR_PROJECT_ID"
35
+ data-widget-api-key="YOUR_WIDGET_API_KEY"
36
+ data-theme="light"
37
+ data-accent-color="#FF6B2C"
38
+ data-position="bottom-left"
39
+ ></script>
59
40
  ```
60
41
 
61
- ## React / Next.js usage
42
+ ### Programmatic control
43
+
44
+ ```js
45
+ window.Bello.push(['open']); // Open the widget
46
+ window.Bello.push(['close']); // Close the widget
47
+ window.Bello.push(['update', { theme: 'light' }]);
48
+ ```
49
+
50
+ ## React / Next.js
62
51
 
63
52
  ```tsx
64
53
  import { BelloWidget } from '@heybello/bello-sdk/react';
@@ -67,42 +56,31 @@ export default function Page() {
67
56
  return (
68
57
  <BelloWidget
69
58
  projectId="YOUR_PROJECT_ID"
70
- apiBaseUrl="https://your-api.example.com"
59
+ widgetApiKey="YOUR_WIDGET_API_KEY"
71
60
  />
72
61
  );
73
62
  }
74
63
  ```
75
64
 
76
- The React package bundles the widget directly and does not require a
77
- separate script tag.
65
+ ## Props / Attributes
78
66
 
79
- ## Local development and testing
67
+ | Prop | Data Attribute | Type | Required | Description |
68
+ |------|---------------|------|----------|-------------|
69
+ | `projectId` | `data-project-id` | `string` | Yes | Your Bello project ID |
70
+ | `widgetApiKey` | `data-widget-api-key` | `string` | Yes | Widget API key from the Deploy step |
71
+ | `theme` | `data-theme` | `'light' \| 'dark'` | No | Override theme |
72
+ | `accentColor` | `data-accent-color` | `string` | No | Override accent color (hex) |
73
+ | `position` | `data-position` | `'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left'` | No | Override widget position |
74
+ | `widgetTitle` | — | `string` | No | Override widget title |
75
+ | `widgetSubtitle` | — | `string` | No | Override subtitle |
76
+ | `widgetButtonTitle` | — | `string` | No | Override CTA button text |
77
+ | `agentEnabled` | `data-agent-enabled` | `boolean` | No | Set `false` for UI-only preview |
80
78
 
81
- ```bash
82
- pnpm install
83
- pnpm dev:iife
84
- ```
79
+ All optional props override your dashboard configuration. If omitted, dashboard settings are used.
85
80
 
86
- Open `http://localhost:5174/src/playground-embed.html` to test the CDN
87
- flow locally.
81
+ ## Getting your credentials
88
82
 
89
- ### Build the npm package
90
-
91
- ```bash
92
- pnpm build
93
- ```
94
-
95
- Outputs:
96
-
97
- - `dist/bello-embed.iife.js` (CDN / IIFE)
98
- - `dist/react.es.js` and `dist/react.cjs` (frameworks)
99
- - `dist/*.d.ts` (types)
100
-
101
- ### Test the package locally in another app
102
-
103
- ```bash
104
- # from your consuming app
105
- pnpm add ../bello-sdk
106
- # or
107
- npm install ../bello-sdk
108
- ```
83
+ 1. Create a project at [bello.ai](https://bello.ai)
84
+ 2. Configure your agent's voice, personality, and knowledge base
85
+ 3. Go to **Deploy** to get your `projectId` and `widgetApiKey`
86
+ 4. Paste the embed code into your site
package/dist/api.d.ts CHANGED
@@ -1,3 +1,14 @@
1
1
  import type { ConnectionDetails, InitOptions, PublicConfig } from './types';
2
- export declare function fetchPublicConfig(opts: InitOptions): Promise<PublicConfig>;
2
+ /**
3
+ * Fetch widget config from the server.
4
+ * Called on SDK init to get the latest config (theme, colors, titles, position).
5
+ */
6
+ export declare function fetchWidgetConfig(opts: InitOptions): Promise<PublicConfig>;
7
+ /**
8
+ * Fetch LiveKit connection details from the public widget token endpoint.
9
+ */
3
10
  export declare function fetchConnectionDetails(opts: InitOptions): Promise<ConnectionDetails>;
11
+ /**
12
+ * Report session end. Fire-and-forget.
13
+ */
14
+ export declare function endWidgetSession(baseUrl: string, sessionId: string): void;