@auticlabs/bulut 1.2.2 → 1.2.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.
package/README.md CHANGED
@@ -1,179 +1,179 @@
1
- # Bulut
2
-
3
- A lightweight, embeddable AI chatbot widget for React, Next.js, and Vite applications. Renders inside a Shadow DOM so its styles never leak into your app.
4
-
5
- ## Features
6
-
7
- - Voice input with real-time STT → LLM → TTS pipeline
8
- - Floating chat window with streaming responses
9
- - Built-in tool calling (page navigation, element interaction)
10
- - Themeable via a single hex colour prop
11
- - Zero-CSS — everything is scoped inside Shadow DOM
12
- - Accessibility mode for hands-free usage
13
- - Tiny footprint — ships as a single JS bundle
14
-
15
- ## Installation
16
-
17
- ```bash
18
- npm install bulutbot
19
- ```
20
-
21
- ## Quick Start
22
-
23
- ### React / Vite
24
-
25
- ```tsx
26
- import { Bulut } from 'bulutbot';
27
-
28
- function App() {
29
- return (
30
- <>
31
- <h1>My App</h1>
32
- <Bulut
33
- projectId="your-project-id"
34
- />
35
- </>
36
- );
37
- }
38
-
39
- export default App;
40
- ```
41
-
42
- ### Next.js (App Router)
43
-
44
- The component is marked `'use client'` internally, so you can use it directly in Server Components:
45
-
46
- ```tsx
47
- // app/layout.tsx
48
- import { Bulut } from 'bulut';
49
-
50
- export default function RootLayout({ children }: { children: React.ReactNode }) {
51
- return (
52
- <html lang="en">
53
- <body>
54
- {children}
55
- <Bulut
56
- projectId="your-project-id"
57
- />
58
- </body>
59
- </html>
60
- );
61
- }
62
- ```
63
-
64
- Or import it inside a client component if you need to control it conditionally:
65
-
66
- ```tsx
67
- // components/ChatWidget.tsx
68
- 'use client';
69
-
70
- import { Bulut } from 'bulut';
71
-
72
- export function ChatWidget() {
73
- return (
74
- <Bulut
75
- projectId="your-project-id"
76
- baseColor="#0ea5e9"
77
- voice="ali"
78
- />
79
- );
80
- }
81
- ```
82
-
83
- ### Next.js (Pages Router)
84
-
85
- ```tsx
86
- // pages/_app.tsx
87
- import type { AppProps } from 'next/app';
88
- import { Bulut } from 'bulut';
89
-
90
- export default function App({ Component, pageProps }: AppProps) {
91
- return (
92
- <>
93
- <Component {...pageProps} />
94
- <Bulut
95
- projectId="your-project-id"
96
- />
97
- </>
98
- );
99
- }
100
- ```
101
-
102
- ### Vanilla HTML (Embed Script)
103
-
104
- For non-React sites, use the `bulut/embed` entry point:
105
-
106
- ```html
107
- <script type="module">
108
- import Bulut from 'https://unpkg.com/bulut/dist/embed.js';
109
- Bulut.init({
110
- projectId: 'your-project-id',
111
- });
112
- </script>
113
- ```
114
-
115
- ## Props
116
-
117
- | Prop | Type | Default | Description |
118
- |------|------|---------|-------------|
119
- | `projectId` | `string` | — | **Required.** Your Bulut project ID. |
120
- | `backendBaseUrl` | `string` | `"http://localhost:8000"` | Backend API URL. |
121
- | `model` | `string` | `"google/gemini-3-flash-preview:nitro"` | LLM model identifier. |
122
- | `voice` | `"alloy" \| "zeynep" \| "ali"` | `"alloy"` | Voice for TTS output. |
123
- | `baseColor` | `string` | `"#6C03C1"` | Primary theme colour (hex). Button, header, and user message bubbles will use this colour. |
124
-
125
- ## Embed API
126
-
127
- When using the `bulut/embed` script entry, the following methods are available:
128
-
129
- ### `Bulut.init(options)`
130
-
131
- Initialize the widget. Accepts the same props as the React component, plus:
132
-
133
- - `containerId` (optional) — ID of an existing DOM element to mount into. If omitted, a container is created automatically.
134
-
135
- ```js
136
- Bulut.init({
137
- projectId: 'your-project-id',
138
- baseColor: '#0ea5e9',
139
- });
140
- ```
141
-
142
- ### `Bulut.destroy()`
143
-
144
- Remove the widget from the page and clean up.
145
-
146
- ### `Bulut.isReady()`
147
-
148
- Returns `true` if the widget is currently initialized.
149
-
150
- ## Theming
151
-
152
- Pass a `baseColor` hex string to change the accent colour across the entire widget:
153
-
154
- ```tsx
155
- <Bulut projectId="..." baseColor="#0ea5e9" />
156
- ```
157
-
158
- The widget inherits the host page's `font-family`, so it will match your site's typography automatically.
159
-
160
- ## How It Works
161
-
162
- The `<Bulut>` React component dynamically imports the Preact-based widget at runtime and mounts it inside a Shadow DOM container. This means:
163
-
164
- 1. **No style conflicts** — widget CSS is fully isolated.
165
- 2. **SSR-safe** — the dynamic import avoids `window`/`document` at build time.
166
- 3. **Lightweight** — Preact keeps the bundle small while React stays your app's framework.
167
-
168
- ## Browser Support
169
-
170
- Modern browsers that support ES2020+:
171
-
172
- - Chrome 80+
173
- - Firefox 80+
174
- - Safari 14+
175
- - Edge 80+
176
-
177
- ## License
178
-
179
- MIT
1
+ # Bulut
2
+
3
+ A lightweight, embeddable AI chatbot widget for React, Next.js, and Vite applications. Renders inside a Shadow DOM so its styles never leak into your app.
4
+
5
+ ## Features
6
+
7
+ - Voice input with real-time STT → LLM → TTS pipeline
8
+ - Floating chat window with streaming responses
9
+ - Built-in tool calling (page navigation, element interaction)
10
+ - Themeable via a single hex colour prop
11
+ - Zero-CSS — everything is scoped inside Shadow DOM
12
+ - Accessibility mode for hands-free usage
13
+ - Tiny footprint — ships as a single JS bundle
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install bulutbot
19
+ ```
20
+
21
+ ## Quick Start
22
+
23
+ ### React / Vite
24
+
25
+ ```tsx
26
+ import { Bulut } from 'bulutbot';
27
+
28
+ function App() {
29
+ return (
30
+ <>
31
+ <h1>My App</h1>
32
+ <Bulut
33
+ projectId="your-project-id"
34
+ />
35
+ </>
36
+ );
37
+ }
38
+
39
+ export default App;
40
+ ```
41
+
42
+ ### Next.js (App Router)
43
+
44
+ The component is marked `'use client'` internally, so you can use it directly in Server Components:
45
+
46
+ ```tsx
47
+ // app/layout.tsx
48
+ import { Bulut } from 'bulut';
49
+
50
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
51
+ return (
52
+ <html lang="en">
53
+ <body>
54
+ {children}
55
+ <Bulut
56
+ projectId="your-project-id"
57
+ />
58
+ </body>
59
+ </html>
60
+ );
61
+ }
62
+ ```
63
+
64
+ Or import it inside a client component if you need to control it conditionally:
65
+
66
+ ```tsx
67
+ // components/ChatWidget.tsx
68
+ 'use client';
69
+
70
+ import { Bulut } from 'bulut';
71
+
72
+ export function ChatWidget() {
73
+ return (
74
+ <Bulut
75
+ projectId="your-project-id"
76
+ baseColor="#0ea5e9"
77
+ voice="ali"
78
+ />
79
+ );
80
+ }
81
+ ```
82
+
83
+ ### Next.js (Pages Router)
84
+
85
+ ```tsx
86
+ // pages/_app.tsx
87
+ import type { AppProps } from 'next/app';
88
+ import { Bulut } from 'bulut';
89
+
90
+ export default function App({ Component, pageProps }: AppProps) {
91
+ return (
92
+ <>
93
+ <Component {...pageProps} />
94
+ <Bulut
95
+ projectId="your-project-id"
96
+ />
97
+ </>
98
+ );
99
+ }
100
+ ```
101
+
102
+ ### Vanilla HTML (Embed Script)
103
+
104
+ For non-React sites, use the `bulut/embed` entry point:
105
+
106
+ ```html
107
+ <script type="module">
108
+ import Bulut from 'https://unpkg.com/bulut/dist/embed.js';
109
+ Bulut.init({
110
+ projectId: 'your-project-id',
111
+ });
112
+ </script>
113
+ ```
114
+
115
+ ## Props
116
+
117
+ | Prop | Type | Default | Description |
118
+ |------|------|---------|-------------|
119
+ | `projectId` | `string` | — | **Required.** Your Bulut project ID. |
120
+ | `backendBaseUrl` | `string` | `"http://localhost:8000"` | Backend API URL. |
121
+ | `model` | `string` | `"google/gemini-3-flash-preview:nitro"` | LLM model identifier. |
122
+ | `voice` | `"alloy" \| "zeynep" \| "ali"` | `"alloy"` | Voice for TTS output. |
123
+ | `baseColor` | `string` | `"#6C03C1"` | Primary theme colour (hex). Button, header, and user message bubbles will use this colour. |
124
+
125
+ ## Embed API
126
+
127
+ When using the `bulut/embed` script entry, the following methods are available:
128
+
129
+ ### `Bulut.init(options)`
130
+
131
+ Initialize the widget. Accepts the same props as the React component, plus:
132
+
133
+ - `containerId` (optional) — ID of an existing DOM element to mount into. If omitted, a container is created automatically.
134
+
135
+ ```js
136
+ Bulut.init({
137
+ projectId: 'your-project-id',
138
+ baseColor: '#0ea5e9',
139
+ });
140
+ ```
141
+
142
+ ### `Bulut.destroy()`
143
+
144
+ Remove the widget from the page and clean up.
145
+
146
+ ### `Bulut.isReady()`
147
+
148
+ Returns `true` if the widget is currently initialized.
149
+
150
+ ## Theming
151
+
152
+ Pass a `baseColor` hex string to change the accent colour across the entire widget:
153
+
154
+ ```tsx
155
+ <Bulut projectId="..." baseColor="#0ea5e9" />
156
+ ```
157
+
158
+ The widget inherits the host page's `font-family`, so it will match your site's typography automatically.
159
+
160
+ ## How It Works
161
+
162
+ The `<Bulut>` React component dynamically imports the Preact-based widget at runtime and mounts it inside a Shadow DOM container. This means:
163
+
164
+ 1. **No style conflicts** — widget CSS is fully isolated.
165
+ 2. **SSR-safe** — the dynamic import avoids `window`/`document` at build time.
166
+ 3. **Lightweight** — Preact keeps the bundle small while React stays your app's framework.
167
+
168
+ ## Browser Support
169
+
170
+ Modern browsers that support ES2020+:
171
+
172
+ - Chrome 80+
173
+ - Firefox 80+
174
+ - Safari 14+
175
+ - Edge 80+
176
+
177
+ ## License
178
+
179
+ MIT