open-chat-studio-widget 0.4.1 → 0.4.2

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.
@@ -59,6 +59,14 @@ export declare class OcsChat {
59
59
  * Array of starter questions that users can click to send (JSON array of strings)
60
60
  */
61
61
  starterQuestions?: string;
62
+ /**
63
+ * Used to associate chat sessions with a specific user across multiple visits/sessions
64
+ */
65
+ userId?: string;
66
+ /**
67
+ * Display name for the user.
68
+ */
69
+ userName?: string;
62
70
  /**
63
71
  * Whether to persist session data to local storage to allow resuming previous conversations after page reload.
64
72
  */
@@ -97,6 +105,7 @@ export declare class OcsChat {
97
105
  showStarterQuestions: boolean;
98
106
  parsedWelcomeMessages: string[];
99
107
  parsedStarterQuestions: string[];
108
+ generatedUserId?: string;
100
109
  isFullscreen: boolean;
101
110
  private messageListRef?;
102
111
  private textareaRef?;
@@ -156,6 +165,7 @@ export declare class OcsChat {
156
165
  private getStorageKeys;
157
166
  private saveSessionToStorage;
158
167
  private loadSessionFromStorage;
168
+ private getOrGenerateUserId;
159
169
  private clearSessionStorage;
160
170
  private isLocalStorageAvailable;
161
171
  private startNewChat;
@@ -47,6 +47,14 @@ export namespace Components {
47
47
  * Array of starter questions that users can click to send (JSON array of strings)
48
48
  */
49
49
  "starterQuestions"?: string;
50
+ /**
51
+ * Used to associate chat sessions with a specific user across multiple visits/sessions
52
+ */
53
+ "userId"?: string;
54
+ /**
55
+ * Display name for the user.
56
+ */
57
+ "userName"?: string;
50
58
  /**
51
59
  * Whether the chat widget is visible on load.
52
60
  */
@@ -110,6 +118,14 @@ declare namespace LocalJSX {
110
118
  * Array of starter questions that users can click to send (JSON array of strings)
111
119
  */
112
120
  "starterQuestions"?: string;
121
+ /**
122
+ * Used to associate chat sessions with a specific user across multiple visits/sessions
123
+ */
124
+ "userId"?: string;
125
+ /**
126
+ * Display name for the user.
127
+ */
128
+ "userName"?: string;
113
129
  /**
114
130
  * Whether the chat widget is visible on load.
115
131
  */
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "open-chat-studio-widget",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Chat component for Open Chat Studio",
5
5
  "main": "dist/index.cjs.js",
6
+ "exports": "./dist/esm/open-chat-studio-widget.js",
7
+ "unpkg": "dist/open-chat-studio-widget/open-chat-studio-widget.esm.js",
6
8
  "module": "dist/index.js",
7
9
  "es2015": "dist/esm/index.mjs",
8
10
  "es2017": "dist/esm/index.mjs",
9
11
  "types": "dist/types/index.d.ts",
10
12
  "collection": "dist/collection/collection-manifest.json",
11
13
  "collection:main": "dist/collection/index.js",
12
- "unpkg": "dist/open-chat-studio-widget/open-chat-studio-widget.esm.js",
13
14
  "repository": {
14
15
  "type": "git",
15
16
  "url": "https://github.com/dimagi/open-chat-studio.git"