@verba-ai/chat-sdk 1.0.5 → 1.0.6

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
@@ -11,30 +11,33 @@ The SDK acts as a secure, high-performance orchestration layer that manages the
11
11
  The easiest way to integrate the chat. It creates a fixed-position action button in the bottom corner of your screen that toggles the chat window.
12
12
 
13
13
  ```typescript
14
- import { ChatSDK } from "@verba-ai/chat-sdk";
14
+ import { ChatSDK } from '@verba-ai/chat-sdk'
15
15
 
16
16
  const chat = new ChatSDK({
17
- // Required: Your unique Verba tenant ID
18
- tenant: "your-tenant-id",
19
-
20
- // Optional
21
- theme: {
22
- primaryColor: "#6366f1",
23
- backgroundColor: "#080b14",
24
- textColor: "#f1f5f9",
25
- },
26
-
27
- // Optional: Configuration for the floating bubble
28
- bubble: {
29
- position: "bottom-right",
30
- color: "#8b5cf6", // custom background gradient/color
31
- size: 56, // size in pixels
32
- icon: "<link>", // src to <img> tag
33
- },
34
- });
17
+ // Required: Your unique Verba tagId
18
+ tagId: 'your-tag-id',
19
+
20
+ // Optional
21
+ theme: {
22
+ primaryColor: '#6366f1',
23
+ backgroundColor: '#080b14',
24
+ textColor: '#f1f5f9',
25
+ },
26
+
27
+ // You can also our default theme presets
28
+ // theme: 'light' | 'dark',
29
+
30
+ // Optional: Configuration for the floating bubble
31
+ bubble: {
32
+ position: 'bottom-right',
33
+ color: '#8b5cf6', // custom background gradient/color
34
+ size: 56, // size in pixels
35
+ icon: '<link>', // src to <img> tag
36
+ },
37
+ })
35
38
 
36
39
  // Inject the bubble into the DOM
37
- chat.init();
40
+ chat.init()
38
41
 
39
42
  // Optional programmatic controls
40
43
  // chat.show();
@@ -47,26 +50,26 @@ chat.init();
47
50
  If you want to render the chat inside a specific part of your page (like a dashboard panel or a dedicated contact page).
48
51
 
49
52
  ```typescript
50
- import { ChatSDK } from "@verba-ai/chat-sdk";
53
+ import { ChatSDK } from '@verba-ai/chat-sdk'
51
54
 
52
55
  // Ensure the container exists in your DOM
53
56
  // <div id="my-chat-container" style="height: 600px;"></div>
54
57
 
55
58
  const chat = new ChatSDK({
56
- tenant: "your-tenant-id",
59
+ tagId: 'your-tag-id',
57
60
 
58
- // Target a CSS selector or pass an HTMLElement directly
59
- container: "#my-chat-container",
61
+ // Target a CSS selector or pass an HTMLElement directly
62
+ container: '#my-chat-container',
60
63
 
61
- // Optional: Advanced visual theming
62
- theme: {
63
- primaryColor: "#6366f1",
64
- backgroundColor: "#080b14",
65
- textColor: "#f1f5f9",
66
- },
67
- });
64
+ // Optional: Advanced visual theming
65
+ theme: {
66
+ primaryColor: '#6366f1',
67
+ backgroundColor: '#080b14',
68
+ textColor: '#f1f5f9',
69
+ },
70
+ })
68
71
 
69
- chat.init();
72
+ chat.init()
70
73
  ```
71
74
 
72
75
  ### 3. Usage via CDN (UMD)
@@ -76,9 +79,9 @@ If you aren't using a bundler (Webpack/Vite/Rollup), you can load the SDK direct
76
79
  ```html
77
80
  <script src="https://unpkg.com/@verba-ai/chat-sdk@latest/dist/chat-sdk.umd.cjs"></script>
78
81
  <script>
79
- const { ChatSDK } = window.VerbaChatSDK;
82
+ const { ChatSDK } = window.VerbaChatSDK
80
83
 
81
- new ChatSDK({ tenant: "your-tenant-id" }).init();
84
+ new ChatSDK({ tagId: 'your-tag-id' }).init()
82
85
  </script>
83
86
  ```
84
87
 
@@ -107,17 +110,17 @@ The main entry point for the widget.
107
110
 
108
111
  ```typescript
109
112
  interface ChatSDKConfig {
110
- /** Your Verba tenant ID (Required) */
111
- tenant: string;
113
+ /** Your Verba tag ID (Required) */
114
+ tagId: string
112
115
 
113
- /** Where to mount the widget. Omit for floating bubble. */
114
- container?: string | HTMLElement;
116
+ /** Where to mount the widget. Omit for floating bubble. */
117
+ container?: string | HTMLElement
115
118
 
116
- /** Visual theme. String preset or detailed config. */
117
- theme?: "light" | "dark" | ThemeConfig;
119
+ /** Visual theme. String preset or detailed config. */
120
+ theme?: 'light' | 'dark' | ThemeConfig
118
121
 
119
- /** Configuration for the floating bubble. */
120
- bubble?: ChatBubbleConfig;
122
+ /** Configuration for the floating bubble. */
123
+ bubble?: ChatBubbleConfig
121
124
  }
122
125
  ```
123
126
 
@@ -125,20 +128,20 @@ interface ChatSDKConfig {
125
128
 
126
129
  ```typescript
127
130
  interface ChatBubbleConfig {
128
- /** Corner position of the floating bubble (Default: 'bottom-right') */
129
- position?: "bottom-right" | "bottom-left";
131
+ /** Corner position of the floating bubble (Default: 'bottom-right') */
132
+ position?: 'bottom-right' | 'bottom-left'
130
133
 
131
- /** Background color of the bubble (Default: '#ffffff') */
132
- color?: string;
134
+ /** Background color of the bubble (Default: '#ffffff') */
135
+ color?: string
133
136
 
134
- /** Size of the bubble in pixels (Default: 56) */
135
- size?: number;
137
+ /** Size of the bubble in pixels (Default: 56) */
138
+ size?: number
136
139
 
137
- /** SVG string for a custom open (chat) icon */
138
- icon?: string;
140
+ /** SVG string for a custom open (chat) icon */
141
+ icon?: string
139
142
 
140
- /** Color of the close (X) icon (Default: '#ffffff') */
141
- closeIconColor?: string;
143
+ /** Color of the close (X) icon (Default: '#ffffff') */
144
+ closeIconColor?: string
142
145
  }
143
146
  ```
144
147
 
@@ -146,9 +149,9 @@ interface ChatBubbleConfig {
146
149
 
147
150
  ```typescript
148
151
  interface ThemeConfig {
149
- primaryColor?: string;
150
- textColor?: string;
151
- backgroundColor?: string;
152
- fontFamily?: string;
152
+ primaryColor?: string
153
+ textColor?: string
154
+ backgroundColor?: string
155
+ fontFamily?: string
153
156
  }
154
157
  ```