@nimbusai/webchat-sdk 1.0.0 → 1.0.1

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
@@ -89,7 +89,7 @@ pnpm add @nimbusai/webchat-sdk
89
89
  import { NimbusChat } from "@nimbusai/webchat-sdk";
90
90
 
91
91
  const chat = new NimbusChat({
92
- agent_id: "550e8400-e29b-41d4-a716-446655440000",
92
+ agent_version_id: "550e8400-e29b-41d4-a716-446655440000",
93
93
  });
94
94
 
95
95
  chat.open();
@@ -101,7 +101,7 @@ chat.open();
101
101
  <script src="https://cdn.nimbus.ai/sdk/nimbus-chat.umd.global.js"></script>
102
102
  <script>
103
103
  NimbusChat.init({
104
- agent_id: "550e8400-e29b-41d4-a716-446655440000",
104
+ agent_version_id: "550e8400-e29b-41d4-a716-446655440000",
105
105
  });
106
106
  </script>
107
107
  ```
@@ -112,7 +112,7 @@ The CDN bundle exposes a global `NimbusChat` object with a singleton `init()` me
112
112
 
113
113
  ```typescript
114
114
  const chat = new NimbusChat({
115
- agent_id: "550e8400-e29b-41d4-a716-446655440000",
115
+ agent_version_id: "550e8400-e29b-41d4-a716-446655440000",
116
116
  style: { position: "bottom-right" }
117
117
  });
118
118
  ```
@@ -144,13 +144,13 @@ const chat = NimbusChat.init(config);
144
144
 
145
145
  ## Configuration Reference
146
146
 
147
- The SDK provides extensive configuration options to customize every aspect of the chat widget. All properties are optional except `agent_id`.
147
+ The SDK provides extensive configuration options to customize every aspect of the chat widget. All properties are optional except `agent_version_id`.
148
148
 
149
149
  ### Required Configuration
150
150
 
151
151
  | Property | Type | Description |
152
152
  |----------|------|-------------|
153
- | `agent_id` | `string` | **Required** - Your agent ID (UUID) |
153
+ | `agent_version_id` | `string` | **Required** - Your agent ID (UUID) |
154
154
 
155
155
  ### Core Settings
156
156
 
@@ -522,7 +522,7 @@ interface ColorPair {
522
522
  ```javascript
523
523
  const chat = new NimbusChat({
524
524
  // Required
525
- agent_id: "550e8400-e29b-41d4-a716-446655440000",
525
+ agent_version_id: "550e8400-e29b-41d4-a716-446655440000",
526
526
 
527
527
  // Core Settings
528
528
  dns: "api.nimbus.ai/api/v1/chat/ws",
@@ -694,7 +694,7 @@ Enable comprehensive logging for development and troubleshooting:
694
694
 
695
695
  ```javascript
696
696
  const chat = new NimbusChat({
697
- agent_id: "your-uuid-here",
697
+ agent_version_id: "your-uuid-here",
698
698
  debug: true
699
699
  });
700
700
  ```
@@ -853,7 +853,7 @@ NimbusChat (orchestrator)
853
853
 
854
854
  ### Connection Lifecycle
855
855
 
856
- 1. **Initial Connection**: Client opens WebSocket with `agent_id` (and `flow_id` if available from localStorage)
856
+ 1. **Initial Connection**: Client opens WebSocket with `agent_version_id` (and `flow_id` if available from localStorage)
857
857
  2. **Connected**: Server responds with `{ "type": "connected", "flow_id": "uuid" }`
858
858
  3. **Persistence**: `flow_id` is always stored in localStorage and reused on reconnect
859
859
  4. **History Loading**: If `resumeConversation: true`, fetches message history via REST API after connection
package/dist/index.d.mts CHANGED
@@ -165,34 +165,6 @@ interface SendButtonConfig {
165
165
  /** If true, align input and send button horizontally on the same row. Default: false */
166
166
  align?: boolean;
167
167
  }
168
- interface ErrorButtonConfig {
169
- /** Background color of the button */
170
- background?: string;
171
- /** Text configuration for the button */
172
- text?: TextConfig;
173
- /** Icon configuration for the button. Pass null to hide. */
174
- icon?: IconConfig | null;
175
- }
176
- interface ErrorStyleConfig {
177
- /** Background color for the error message */
178
- background?: string;
179
- /** Title configuration for the error message. Pass null to use default. */
180
- title?: TextElement | null;
181
- /** Subtitle configuration for the error message. Pass null to use default. */
182
- subtitle?: TextElement | null;
183
- /** Button configuration for the error */
184
- button?: ErrorButtonConfig;
185
- }
186
- interface ErrorConfig {
187
- /** Styling for inactivity timeout errors */
188
- inactivity?: ErrorStyleConfig;
189
- /** Styling for session conflict errors */
190
- conflict?: ErrorStyleConfig;
191
- /** Styling for session TTL expiration errors */
192
- session_ttl?: ErrorStyleConfig;
193
- /** Styling for unauthorized access errors */
194
- unauthorized?: ErrorStyleConfig;
195
- }
196
168
  interface BubbleConfig {
197
169
  /** Position of the floating bubble. Default: "bottom-right" */
198
170
  position?: BubblePosition;
@@ -202,8 +174,8 @@ interface BubbleConfig {
202
174
  icon?: IconConfig | null;
203
175
  }
204
176
  interface NimbusChatConfig {
205
- /** Required — the agent ID (UUID) for this chat instance */
206
- agent_id: string;
177
+ /** Required — the agent version ID (UUID) for this chat instance */
178
+ agent_version_id: string;
207
179
  /** DNS endpoint for chat services. Default: "api.nimbus.ai/api/v1/webchat" */
208
180
  dns?: string;
209
181
  /** Whether to resume previous conversation on reconnect. Default: false */
@@ -228,8 +200,6 @@ interface NimbusChatConfig {
228
200
  sendButton?: SendButtonConfig;
229
201
  /** Welcome message configuration shown when chat is empty. */
230
202
  welcome?: WelcomeConfig;
231
- /** Error styling configuration for conflict and inactivity errors */
232
- error?: ErrorConfig;
233
203
  /** Enable debug logging to console. Default: false */
234
204
  debug?: boolean;
235
205
  /** Reconnection configuration for unexpected disconnections */
@@ -244,7 +214,7 @@ interface NimbusChatConfig {
244
214
  showMore?: ShowMoreConfig;
245
215
  }
246
216
  interface ResolvedConfig {
247
- agent_id: string;
217
+ agent_version_id: string;
248
218
  dns: string;
249
219
  resumeConversation: boolean;
250
220
  style: {
@@ -284,7 +254,6 @@ interface ResolvedConfig {
284
254
  };
285
255
  sendButton: Required<Pick<SendButtonConfig, "align">> & Pick<SendButtonConfig, "icon">;
286
256
  welcome: WelcomeConfig;
287
- error: Required<ErrorConfig>;
288
257
  debug: boolean;
289
258
  reconnect: ReconnectConfig;
290
259
  allowNewChat: boolean;
@@ -314,11 +283,11 @@ declare const ICON_SIZES: {
314
283
  * Main SDK orchestrator.
315
284
  *
316
285
  * Usage (npm):
317
- * const chat = new NimbusChat({ agent_id: "550e8400-e29b-41d4-a716-446655440000" });
286
+ * const chat = new NimbusChat({ agent_version_id: "550e8400-e29b-41d4-a716-446655440000" });
318
287
  * chat.open();
319
288
  *
320
289
  * Usage (CDN):
321
- * NimbusChat.init({ agent_id: "550e8400-e29b-41d4-a716-446655440000" });
290
+ * NimbusChat.init({ agent_version_id: "550e8400-e29b-41d4-a716-446655440000" });
322
291
  */
323
292
  declare class NimbusChat {
324
293
  private config;
@@ -389,7 +358,7 @@ type ConnectionState = "idle" | "connecting" | "connected" | "disconnected";
389
358
  * Initialize the NimbusChat widget (singleton pattern).
390
359
  * Use this when loading via CDN <script> tag.
391
360
  *
392
- * NimbusChat.init({ agent_id: "550e8400-e29b-41d4-a716-446655440000" });
361
+ * NimbusChat.init({ agent_version_id: "550e8400-e29b-41d4-a716-446655440000" });
393
362
  */
394
363
  declare function init(config: NimbusChatConfig): NimbusChat;
395
364
  /**
@@ -403,4 +372,4 @@ declare const _default: {
403
372
  getInstance: typeof getInstance;
404
373
  };
405
374
 
406
- export { type BubbleConfig, type BubblePosition, type ChatMessage, type ChatPosition, type ColorPair, type ConnectionState, type ErrorButtonConfig, type ErrorConfig, type ErrorStyleConfig, type HeaderConfig, ICON_NAMES, ICON_SIZES, type IconConfig, type InputConfig, type MessageConfig, type MessageType, NimbusChat, type NimbusChatConfig, type ResolvedConfig, type SendButtonConfig, type ServerMessage, type TextConfig, type TextElement, type ThemeConfig, type UserMessage, type WelcomeConfig, _default as default, getInstance, init };
375
+ export { type BubbleConfig, type BubblePosition, type ChatMessage, type ChatPosition, type ColorPair, type ConnectionState, type HeaderConfig, ICON_NAMES, ICON_SIZES, type IconConfig, type InputConfig, type MessageConfig, type MessageType, NimbusChat, type NimbusChatConfig, type ResolvedConfig, type SendButtonConfig, type ServerMessage, type TextConfig, type TextElement, type ThemeConfig, type UserMessage, type WelcomeConfig, _default as default, getInstance, init };
package/dist/index.d.ts CHANGED
@@ -165,34 +165,6 @@ interface SendButtonConfig {
165
165
  /** If true, align input and send button horizontally on the same row. Default: false */
166
166
  align?: boolean;
167
167
  }
168
- interface ErrorButtonConfig {
169
- /** Background color of the button */
170
- background?: string;
171
- /** Text configuration for the button */
172
- text?: TextConfig;
173
- /** Icon configuration for the button. Pass null to hide. */
174
- icon?: IconConfig | null;
175
- }
176
- interface ErrorStyleConfig {
177
- /** Background color for the error message */
178
- background?: string;
179
- /** Title configuration for the error message. Pass null to use default. */
180
- title?: TextElement | null;
181
- /** Subtitle configuration for the error message. Pass null to use default. */
182
- subtitle?: TextElement | null;
183
- /** Button configuration for the error */
184
- button?: ErrorButtonConfig;
185
- }
186
- interface ErrorConfig {
187
- /** Styling for inactivity timeout errors */
188
- inactivity?: ErrorStyleConfig;
189
- /** Styling for session conflict errors */
190
- conflict?: ErrorStyleConfig;
191
- /** Styling for session TTL expiration errors */
192
- session_ttl?: ErrorStyleConfig;
193
- /** Styling for unauthorized access errors */
194
- unauthorized?: ErrorStyleConfig;
195
- }
196
168
  interface BubbleConfig {
197
169
  /** Position of the floating bubble. Default: "bottom-right" */
198
170
  position?: BubblePosition;
@@ -202,8 +174,8 @@ interface BubbleConfig {
202
174
  icon?: IconConfig | null;
203
175
  }
204
176
  interface NimbusChatConfig {
205
- /** Required — the agent ID (UUID) for this chat instance */
206
- agent_id: string;
177
+ /** Required — the agent version ID (UUID) for this chat instance */
178
+ agent_version_id: string;
207
179
  /** DNS endpoint for chat services. Default: "api.nimbus.ai/api/v1/webchat" */
208
180
  dns?: string;
209
181
  /** Whether to resume previous conversation on reconnect. Default: false */
@@ -228,8 +200,6 @@ interface NimbusChatConfig {
228
200
  sendButton?: SendButtonConfig;
229
201
  /** Welcome message configuration shown when chat is empty. */
230
202
  welcome?: WelcomeConfig;
231
- /** Error styling configuration for conflict and inactivity errors */
232
- error?: ErrorConfig;
233
203
  /** Enable debug logging to console. Default: false */
234
204
  debug?: boolean;
235
205
  /** Reconnection configuration for unexpected disconnections */
@@ -244,7 +214,7 @@ interface NimbusChatConfig {
244
214
  showMore?: ShowMoreConfig;
245
215
  }
246
216
  interface ResolvedConfig {
247
- agent_id: string;
217
+ agent_version_id: string;
248
218
  dns: string;
249
219
  resumeConversation: boolean;
250
220
  style: {
@@ -284,7 +254,6 @@ interface ResolvedConfig {
284
254
  };
285
255
  sendButton: Required<Pick<SendButtonConfig, "align">> & Pick<SendButtonConfig, "icon">;
286
256
  welcome: WelcomeConfig;
287
- error: Required<ErrorConfig>;
288
257
  debug: boolean;
289
258
  reconnect: ReconnectConfig;
290
259
  allowNewChat: boolean;
@@ -314,11 +283,11 @@ declare const ICON_SIZES: {
314
283
  * Main SDK orchestrator.
315
284
  *
316
285
  * Usage (npm):
317
- * const chat = new NimbusChat({ agent_id: "550e8400-e29b-41d4-a716-446655440000" });
286
+ * const chat = new NimbusChat({ agent_version_id: "550e8400-e29b-41d4-a716-446655440000" });
318
287
  * chat.open();
319
288
  *
320
289
  * Usage (CDN):
321
- * NimbusChat.init({ agent_id: "550e8400-e29b-41d4-a716-446655440000" });
290
+ * NimbusChat.init({ agent_version_id: "550e8400-e29b-41d4-a716-446655440000" });
322
291
  */
323
292
  declare class NimbusChat {
324
293
  private config;
@@ -389,7 +358,7 @@ type ConnectionState = "idle" | "connecting" | "connected" | "disconnected";
389
358
  * Initialize the NimbusChat widget (singleton pattern).
390
359
  * Use this when loading via CDN <script> tag.
391
360
  *
392
- * NimbusChat.init({ agent_id: "550e8400-e29b-41d4-a716-446655440000" });
361
+ * NimbusChat.init({ agent_version_id: "550e8400-e29b-41d4-a716-446655440000" });
393
362
  */
394
363
  declare function init(config: NimbusChatConfig): NimbusChat;
395
364
  /**
@@ -403,4 +372,4 @@ declare const _default: {
403
372
  getInstance: typeof getInstance;
404
373
  };
405
374
 
406
- export { type BubbleConfig, type BubblePosition, type ChatMessage, type ChatPosition, type ColorPair, type ConnectionState, type ErrorButtonConfig, type ErrorConfig, type ErrorStyleConfig, type HeaderConfig, ICON_NAMES, ICON_SIZES, type IconConfig, type InputConfig, type MessageConfig, type MessageType, NimbusChat, type NimbusChatConfig, type ResolvedConfig, type SendButtonConfig, type ServerMessage, type TextConfig, type TextElement, type ThemeConfig, type UserMessage, type WelcomeConfig, _default as default, getInstance, init };
375
+ export { type BubbleConfig, type BubblePosition, type ChatMessage, type ChatPosition, type ColorPair, type ConnectionState, type HeaderConfig, ICON_NAMES, ICON_SIZES, type IconConfig, type InputConfig, type MessageConfig, type MessageType, NimbusChat, type NimbusChatConfig, type ResolvedConfig, type SendButtonConfig, type ServerMessage, type TextConfig, type TextElement, type ThemeConfig, type UserMessage, type WelcomeConfig, _default as default, getInstance, init };