@usecrow/ui 0.1.54 → 0.1.55

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/dist/index.cjs CHANGED
@@ -70,6 +70,7 @@ function useChat({
70
70
  persistAnonymousConversations,
71
71
  welcomeMessage,
72
72
  selectedModel: initialSelectedModel,
73
+ subdomain,
73
74
  toolConsentSettings,
74
75
  onVerificationStatus,
75
76
  onConversationId,
@@ -152,6 +153,7 @@ function useChat({
152
153
  conversation_id: conversationId,
153
154
  identity_token: identityToken,
154
155
  model: selectedModel,
156
+ subdomain,
155
157
  user_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
156
158
  user_local_time: (/* @__PURE__ */ new Date()).toLocaleString("en-US", { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", hour12: true }),
157
159
  page_path: typeof window !== "undefined" ? window.location.pathname : void 0,
@@ -484,7 +486,7 @@ function useChat({
484
486
  abortControllerRef.current = null;
485
487
  }
486
488
  },
487
- [apiUrl, productId, conversationId, selectedModel, persistAnonymousConversations, onVerificationStatus, onConversationId, onWorkflowEvent, onToolCall, onToolResult]
489
+ [apiUrl, productId, conversationId, selectedModel, subdomain, persistAnonymousConversations, onVerificationStatus, onConversationId, onWorkflowEvent, onToolCall, onToolResult]
488
490
  );
489
491
  const sendMessage = React3.useCallback(
490
492
  (content) => {
@@ -575,6 +577,7 @@ function useChat({
575
577
  result,
576
578
  identity_token: identityToken,
577
579
  model: selectedModel,
580
+ subdomain,
578
581
  user_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
579
582
  user_local_time: (/* @__PURE__ */ new Date()).toLocaleString("en-US", { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", hour12: true })
580
583
  })
@@ -853,7 +856,7 @@ function useChat({
853
856
  setIsLoading(false);
854
857
  }
855
858
  },
856
- [apiUrl, productId, conversationId, selectedModel]
859
+ [apiUrl, productId, conversationId, selectedModel, subdomain]
857
860
  );
858
861
  const addMessage = React3.useCallback(
859
862
  async (role, content) => {
@@ -3513,6 +3516,7 @@ function injectStyles(target = document) {
3513
3516
  function CrowWidget({
3514
3517
  productId,
3515
3518
  apiUrl = "",
3519
+ subdomain,
3516
3520
  variant = "floating",
3517
3521
  styles: propStyles,
3518
3522
  previewMode = false,
@@ -3586,6 +3590,7 @@ function CrowWidget({
3586
3590
  persistAnonymousConversations,
3587
3591
  welcomeMessage,
3588
3592
  selectedModel,
3593
+ subdomain,
3589
3594
  toolConsentSettings,
3590
3595
  onVerificationStatus: (isVerified) => {
3591
3596
  setIsVerifiedUser(isVerified);
@@ -4329,6 +4334,7 @@ function CopilotContainer({
4329
4334
  function CrowCopilot({
4330
4335
  productId,
4331
4336
  apiUrl = "",
4337
+ subdomain,
4332
4338
  variant = "embedded",
4333
4339
  title = "Copilot",
4334
4340
  agentName: agentNameProp,
@@ -4552,6 +4558,7 @@ function CrowCopilot({
4552
4558
  persistAnonymousConversations,
4553
4559
  welcomeMessage,
4554
4560
  selectedModel,
4561
+ subdomain,
4555
4562
  toolConsentSettings,
4556
4563
  onVerificationStatus: (isVerified) => {
4557
4564
  setIsVerifiedUser(isVerified);
@@ -5439,11 +5446,12 @@ function CrowProvider({
5439
5446
  children,
5440
5447
  productId,
5441
5448
  apiUrl,
5442
- model
5449
+ model,
5450
+ subdomain
5443
5451
  }) {
5444
5452
  const clientRef = React3.useRef(null);
5445
5453
  if (!clientRef.current) {
5446
- clientRef.current = new client.CrowClient({ productId, apiUrl, model });
5454
+ clientRef.current = new client.CrowClient({ productId, apiUrl, model, subdomain });
5447
5455
  }
5448
5456
  const client$1 = clientRef.current;
5449
5457
  React3.useEffect(() => {