@fluxy-chat/ui-kit 0.1.3 → 0.1.4

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.
@@ -9,6 +9,8 @@ export interface FluxyChatWidgetProps {
9
9
  userId?: string;
10
10
  /** Join a public room with joinPublicRoomAsGuest (no member JWT). */
11
11
  guest?: boolean;
12
+ /** Optional pk_ key sent with guest-session (hosted multi-tenant). */
13
+ publishableKey?: string;
12
14
  displayName?: string;
13
15
  theme?: FluxyThemeId;
14
16
  className?: string;
@@ -16,4 +18,4 @@ export interface FluxyChatWidgetProps {
16
18
  title?: string;
17
19
  }
18
20
  /** Drop-in chat widget — polished UI out of the box. */
19
- export declare function FluxyChatWidget({ roomId, client: clientProp, workerUrl, token, userId, guest, displayName, theme, className, height, title, }: FluxyChatWidgetProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function FluxyChatWidget({ roomId, client: clientProp, workerUrl, token, userId, guest, publishableKey, displayName, theme, className, height, title, }: FluxyChatWidgetProps): import("react/jsx-runtime").JSX.Element;
@@ -13,7 +13,7 @@ function WidgetInner({ roomId, title, client, }) {
13
13
  return (_jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [title && (_jsxs("header", { className: "border-b border-border px-4 py-2 text-sm font-semibold", children: [title, _jsx("span", { className: "ml-2 font-normal text-muted-foreground", children: connectionState.status })] })), _jsx("div", { className: "min-h-0 flex-1", children: _jsx(ChatWindow, { messages: messages, online: online, typingUsers: typingUsers, onSend: (text) => sendMessage(text) }) })] }));
14
14
  }
15
15
  /** Drop-in chat widget — polished UI out of the box. */
16
- export function FluxyChatWidget({ roomId, client: clientProp, workerUrl, token, userId = "user-1", guest = false, displayName, theme = "default", className, height = 480, title, }) {
16
+ export function FluxyChatWidget({ roomId, client: clientProp, workerUrl, token, userId = "user-1", guest = false, publishableKey, displayName, theme = "default", className, height = 480, title, }) {
17
17
  const tokenClient = useMemo(() => {
18
18
  if (clientProp)
19
19
  return clientProp;
@@ -37,7 +37,10 @@ export function FluxyChatWidget({ roomId, client: clientProp, workerUrl, token,
37
37
  return;
38
38
  }
39
39
  let cancelled = false;
40
- void FluxyChatClient.joinPublicRoomAsGuest(workerUrl.trim(), roomId, { displayName })
40
+ void FluxyChatClient.joinPublicRoomAsGuest(workerUrl.trim(), roomId, {
41
+ displayName,
42
+ publishableKey,
43
+ })
41
44
  .then((session) => {
42
45
  if (cancelled)
43
46
  return;
@@ -55,7 +58,7 @@ export function FluxyChatWidget({ roomId, client: clientProp, workerUrl, token,
55
58
  return () => {
56
59
  cancelled = true;
57
60
  };
58
- }, [clientProp, token, guest, workerUrl, roomId, displayName]);
61
+ }, [clientProp, token, guest, workerUrl, roomId, displayName, publishableKey]);
59
62
  const client = tokenClient ?? guestClient;
60
63
  if (!client) {
61
64
  return (_jsx("div", { className: className, style: { height, padding: 16, border: "1px solid #e4e4e7", borderRadius: 12 }, children: _jsx("p", { style: { margin: 0, fontSize: 14 }, children: guestError ??
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluxy-chat/ui-kit",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Polished drop-in FluxyChat widget and inbox — built on @fluxy-chat/ui with optional assistant-ui runtime",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,8 +30,8 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "@fluxy-chat/sdk": "0.6.5",
34
- "@fluxy-chat/react": "0.1.4",
33
+ "@fluxy-chat/react": "0.1.6",
34
+ "@fluxy-chat/sdk": "0.6.8",
35
35
  "@fluxy-chat/ui": "0.1.4"
36
36
  },
37
37
  "devDependencies": {