cmcts-c-agent-embedding 1.1.2-cmcuni → 1.1.5-cmcuni

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
@@ -1,349 +1,349 @@
1
- <!-- markdownlint-disable MD030 -->
2
-
3
- # Flowise Embed
4
-
5
- Javascript library to display flowise chatbot on your website
6
-
7
- ![Flowise](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/images/ChatEmbed.gif?raw=true)
8
-
9
- Install:
10
-
11
- ```bash
12
- yarn install --frozen-lockfile
13
- ```
14
-
15
- Dev:
16
-
17
- ```bash
18
- yarn dev
19
- ```
20
-
21
- A development server will be running on http://localhost:5678 automatically. Update `public/index.html` to connect directly to Flowise:
22
-
23
- ```html
24
- <!-- public/index.html -->
25
- <script type="module">
26
- import Chatbot from 'https://localhost:5678/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
27
- Chatbot.init({
28
- chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f', // Add your Flowise chatflowid
29
- apiHost: 'https://your-flowise-instance.com', // Add your Flowise apiHost
30
- });
31
- </script>
32
- ```
33
-
34
- Build:
35
-
36
- ```bash
37
- yarn build
38
- ```
39
-
40
- ## Embed in your HTML
41
-
42
- ### PopUp
43
-
44
- ```html
45
- <script type="module">
46
- import Chatbot from 'https://cdn.jsdelivr.net/npm/c-agent-embedding@latest/dist/web.js';
47
- Chatbot.init({
48
- chatflowid: '<chatflowid>',
49
- apiHost: 'http://localhost:3000',
50
- });
51
- </script>
52
- ```
53
-
54
- ### FullPage
55
-
56
- ```html
57
- <script type="module">
58
- import Chatbot from 'https://cdn.jsdelivr.net/npm/c-agent-embedding@latest/dist/web.js';
59
- Chatbot.initFull({
60
- chatflowid: '<chatflowid>',
61
- apiHost: 'http://localhost:3000',
62
- });
63
- </script>
64
- <flowise-fullchatbot></flowise-fullchatbot>
65
- ```
66
-
67
- To enable full screen, add `margin: 0` to <code>body</code> style, and confirm you don't set height and width
68
-
69
- ```html
70
- <body style="margin: 0">
71
- <script type="module">
72
- import Chatbot from 'https://cdn.jsdelivr.net/npm/c-agent-embedding@latest/dist/web.js';
73
- Chatbot.initFull({
74
- chatflowid: '<chatflowid>',
75
- apiHost: 'http://localhost:3000',
76
- theme: {
77
- chatWindow: {
78
- // height: 700, don't set height
79
- // width: 400, don't set width
80
- },
81
- },
82
- });
83
- </script>
84
- </body>
85
- ```
86
-
87
- ## Configuration
88
-
89
- You can also customize chatbot with different configuration
90
-
91
- ```html
92
- <script type="module">
93
- import Chatbot from 'https://cdn.jsdelivr.net/npm/c-agent-embedding/dist/web.js';
94
- Chatbot.init({
95
- chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f',
96
- apiHost: 'http://localhost:3000',
97
- chatflowConfig: {
98
- // topK: 2
99
- },
100
- observersConfig: {
101
- // (optional) Allows you to execute code in parent based upon signal observations within the chatbot.
102
- // The userinput field submitted to bot ("" when reset by bot)
103
- observeUserInput: (userInput) => {
104
- console.log({ userInput });
105
- },
106
- // The bot message stack has changed
107
- observeMessages: (messages) => {
108
- console.log({ messages });
109
- },
110
- // The bot loading signal changed
111
- observeLoading: (loading) => {
112
- console.log({ loading });
113
- },
114
- },
115
- theme: {
116
- button: {
117
- backgroundColor: '#3B81F6',
118
- right: 20,
119
- bottom: 20,
120
- size: 48, // small | medium | large | number
121
- dragAndDrop: true,
122
- iconColor: 'white',
123
- customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
124
- autoWindowOpen: {
125
- autoOpen: true, //parameter to control automatic window opening
126
- openDelay: 2, // Optional parameter for delay time in seconds
127
- autoOpenOnMobile: false, //parameter to control automatic window opening in mobile
128
- },
129
- },
130
- tooltip: {
131
- showTooltip: true,
132
- tooltipMessage: 'Hi There 👋!',
133
- tooltipBackgroundColor: 'black',
134
- tooltipTextColor: 'white',
135
- tooltipFontSize: 16,
136
- },
137
- disclaimer: {
138
- title: 'Disclaimer',
139
- message: 'By using this chatbot, you agree to the <a target="_blank" href="https://flowiseai.com/terms">Terms & Condition</a>',
140
- textColor: 'black',
141
- buttonColor: '#3b82f6',
142
- buttonText: 'Start Chatting',
143
- buttonTextColor: 'white',
144
- blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)', //The color of the blurred background that overlays the chat interface
145
- backgroundColor: 'white',
146
- },
147
- customCSS: ``, // Add custom CSS styles. Use !important to override default styles
148
- chatWindow: {
149
- showTitle: true,
150
- showAgentMessages: true,
151
- title: 'Flowise Bot',
152
- titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
153
- welcomeMessage: 'Hello! This is custom welcome message',
154
- errorMessage: 'This is a custom error message',
155
- backgroundColor: '#ffffff',
156
- backgroundImage: 'enter image path or link', // If set, this will overlap the background color of the chat window.
157
- height: 700,
158
- width: 400,
159
- fontSize: 16,
160
- starterPrompts: ['What is a bot?', 'Who are you?'], // It overrides the starter prompts set by the chat flow passed
161
- starterPromptFontSize: 15,
162
- clearChatOnReload: false, // If set to true, the chat will be cleared when the page reloads
163
- sourceDocsTitle: 'Sources:',
164
- renderHTML: true,
165
- botMessage: {
166
- backgroundColor: '#f7f8ff',
167
- textColor: '#303235',
168
- showAvatar: true,
169
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
170
- },
171
- userMessage: {
172
- backgroundColor: '#3B81F6',
173
- textColor: '#ffffff',
174
- showAvatar: true,
175
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
176
- },
177
- textInput: {
178
- placeholder: 'Type your question',
179
- backgroundColor: '#ffffff',
180
- textColor: '#303235',
181
- sendButtonColor: '#3B81F6',
182
- maxChars: 50,
183
- maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
184
- autoFocus: true, // If not used, autofocus is disabled on mobile and enabled on desktop. true enables it on both, false disables it on both.
185
- sendMessageSound: true,
186
- // sendSoundLocation: "send_message.mp3", // If this is not used, the default sound effect will be played if sendSoundMessage is true.
187
- receiveMessageSound: true,
188
- // receiveSoundLocation: "receive_message.mp3", // If this is not used, the default sound effect will be played if receiveSoundMessage is true.
189
- },
190
- feedback: {
191
- color: '#303235',
192
- },
193
- dateTimeToggle: {
194
- date: true,
195
- time: true,
196
- },
197
- footer: {
198
- textColor: '#303235',
199
- text: 'Powered by',
200
- company: 'C-agent',
201
- companyLink: 'https://cmcts.ai.com',
202
- },
203
- },
204
- },
205
- });
206
- </script>
207
- ```
208
-
209
- ## (Experimental) Proxy Server Setup
210
-
211
- The Flowise Embed Proxy Server enhances the security of your chatbot implementation by acting as a protective intermediary layer. This server eliminates the need to expose sensitive Flowise instance details in your frontend code and provides several key security benefits:
212
-
213
- ![Proxy Server](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/images/proxyserver.png?raw=true)
214
-
215
- - **Enhanced Security**: Conceals your Flowise API host and chatflow IDs from client-side exposure
216
- - **Access Control**: Implements strict domain-based restrictions for chatbot embedding
217
- - **Secure Communication**: Acts as a secure gateway for all interactions between your website and Flowise instance
218
- - **Authentication Management**: Handles API key authentication securely on the server side, away from client exposure
219
-
220
- This proxy server can be deployed to any Node.js hosting platform.
221
-
222
- ## Quick Start
223
-
224
- 1. Configure environment:
225
-
226
- ```bash
227
- # Copy .env.example to .env and configure required settings:
228
- API_HOST=https://your-flowise-instance.com
229
- FLOWISE_API_KEY=your-api-key
230
-
231
- # Configure your chatflows:
232
- # Format: [identifier]=[chatflowId],[allowedDomain1],[allowedDomain2],...
233
- #
234
- # identifier: Any name you choose (e.g., agent1, support, salesbot)
235
- # chatflowId: The UUID of your Flowise chatflow
236
- # allowedDomains: Comma-separated list of domains where this chat can be embedded
237
- #
238
- # Examples:
239
- support=abc123-def456,https://example.com
240
- agent1=xyz789-uvw456,https://sales.example.com
241
- helpdesk=ghi123-jkl456,https://help.example.com,https://support.example.com
242
- ```
243
-
244
- 2. Install dependencies: (assuming you did not run `yarn install` yet)
245
-
246
- ```bash
247
- yarn install
248
- ```
249
-
250
- 3. Start proxy server:
251
-
252
- ```bash
253
- yarn start
254
- # Server will be available at:
255
- # - Local: http://localhost:3001
256
- # - Cloud: [Your Platform URL] (e.g., https://your-app.herokuapp.com)
257
- ```
258
-
259
- 4. Once the proxy server is running in production, you will be able to embed your chatbots safely without exposing your Flowise API host and chatflow IDs as below:
260
-
261
- ```html
262
- <script type="module">
263
- import Chatbot from 'your-proxy-server-url/web.js'; // Must be 'your-proxy-server-url/web.js'
264
- Chatbot.init({
265
- chatflowid: 'your-identifier-here', // Must match an identifier from your .env
266
- apiHost: 'your-proxy-server-url', // Must match the URL of your proxy server
267
- chatflowConfig: {
268
- // ...
269
- },
270
- });
271
- </script>
272
- ```
273
-
274
- 5. (optional) If you want to test any identifier in public/index.html, you can update it as below:
275
-
276
- ```html
277
- <!-- public/index.html -->
278
- chatflowid: 'your-identifier-here' // Must match an identifier from your .env
279
- ```
280
-
281
- **Important Notes:**
282
-
283
- - To ensure secure embedding, you must explicitly whitelist the websites authorized to embed each chatbot. This configuration is done within the .env file. Note that this also applies to your server's URL when deployed to a cloud environment, or http://localhost:3001 for local development, if needed you must whitelist it as well.
284
- - Wildcard domains (\*) are not supported for security reasons
285
- - Identifiers are case-insensitive (e.g., 'Support' and 'support' are treated the same)
286
-
287
- ## Cloud Deployment Requirements
288
-
289
- When deploying to cloud platforms, you must configure the environment variables directly in your platform. The proxy server will not start without these variables being properly set. Compatible with Nixpacks for automatic deployment configuration.
290
-
291
- ## Development Mode (For Local Testing)
292
-
293
- 1. Configure your environment variables (see above)
294
-
295
- 2. Start the proxy server:
296
-
297
- ```bash
298
- yarn start
299
- # Server will be available at:
300
- # - Local: http://localhost:3001
301
- ```
302
-
303
- 3. Update the test page configuration:
304
-
305
- - Open `public/index.html` in your code editor
306
- - Modify the `chatflowid` and `apiHost` to match your `.env` settings:
307
-
308
- ```html
309
- <!-- public/index.html -->
310
- <script type="module">
311
- import Chatbot from './web.js';
312
- Chatbot.init({
313
- chatflowid: 'agent1', // Must match an identifier from your .env
314
- apiHost: 'http://localhost:3001', // Change this from window.location.origin to 'http://localhost:3001'
315
- });
316
- </script>
317
- ```
318
-
319
- For full page testing, use this configuration instead:
320
-
321
- ```html
322
- <!-- public/index.html -->
323
- <flowise-fullchatbot></flowise-fullchatbot>
324
- <script type="module">
325
- import Chatbot from './web.js';
326
- Chatbot.initFull({
327
- chatflowid: 'agent1', // Must match an identifier from your .env
328
- apiHost: 'http://localhost:3001', // Change this from window.location.origin to 'http://localhost:3001'
329
- });
330
- </script>
331
- ```
332
-
333
- 4. While the proxy server is running, open a new terminal and start the development server:
334
-
335
- ```bash
336
- yarn dev
337
- # This will serve the test page on http://localhost:5678 automatically
338
- ```
339
-
340
- 5. Test the chatbot:
341
-
342
- - Navigate to http://localhost:5678
343
- - The chatbot should now be visible and functional
344
-
345
- **Note:** The development URL (http://localhost:5678) is automatically added to allowed domains in development mode. You don't need to add it manually.
346
-
347
- ## License
348
-
349
- Source code in this repository is made available under the [MIT License](https://github.com/FlowiseAI/Flowise/blob/master/LICENSE.md).
1
+ <!-- markdownlint-disable MD030 -->
2
+
3
+ # Flowise Embed
4
+
5
+ Javascript library to display flowise chatbot on your website
6
+
7
+ ![Flowise](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/images/ChatEmbed.gif?raw=true)
8
+
9
+ Install:
10
+
11
+ ```bash
12
+ yarn install --frozen-lockfile
13
+ ```
14
+
15
+ Dev:
16
+
17
+ ```bash
18
+ yarn dev
19
+ ```
20
+
21
+ A development server will be running on http://localhost:5678 automatically. Update `public/index.html` to connect directly to Flowise:
22
+
23
+ ```html
24
+ <!-- public/index.html -->
25
+ <script type="module">
26
+ import Chatbot from 'https://localhost:5678/web.js'; // Change to from './web.js' to 'https://localhost:5678/web.js'
27
+ Chatbot.init({
28
+ chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f', // Add your Flowise chatflowid
29
+ apiHost: 'https://your-flowise-instance.com', // Add your Flowise apiHost
30
+ });
31
+ </script>
32
+ ```
33
+
34
+ Build:
35
+
36
+ ```bash
37
+ yarn build
38
+ ```
39
+
40
+ ## Embed in your HTML
41
+
42
+ ### PopUp
43
+
44
+ ```html
45
+ <script type="module">
46
+ import Chatbot from 'https://cdn.jsdelivr.net/npm/c-agent-embedding@latest/dist/web.js';
47
+ Chatbot.init({
48
+ chatflowid: '<chatflowid>',
49
+ apiHost: 'http://localhost:3000',
50
+ });
51
+ </script>
52
+ ```
53
+
54
+ ### FullPage
55
+
56
+ ```html
57
+ <script type="module">
58
+ import Chatbot from 'https://cdn.jsdelivr.net/npm/c-agent-embedding@latest/dist/web.js';
59
+ Chatbot.initFull({
60
+ chatflowid: '<chatflowid>',
61
+ apiHost: 'http://localhost:3000',
62
+ });
63
+ </script>
64
+ <flowise-fullchatbot></flowise-fullchatbot>
65
+ ```
66
+
67
+ To enable full screen, add `margin: 0` to <code>body</code> style, and confirm you don't set height and width
68
+
69
+ ```html
70
+ <body style="margin: 0">
71
+ <script type="module">
72
+ import Chatbot from 'https://cdn.jsdelivr.net/npm/c-agent-embedding@latest/dist/web.js';
73
+ Chatbot.initFull({
74
+ chatflowid: '<chatflowid>',
75
+ apiHost: 'http://localhost:3000',
76
+ theme: {
77
+ chatWindow: {
78
+ // height: 700, don't set height
79
+ // width: 400, don't set width
80
+ },
81
+ },
82
+ });
83
+ </script>
84
+ </body>
85
+ ```
86
+
87
+ ## Configuration
88
+
89
+ You can also customize chatbot with different configuration
90
+
91
+ ```html
92
+ <script type="module">
93
+ import Chatbot from 'https://cdn.jsdelivr.net/npm/c-agent-embedding/dist/web.js';
94
+ Chatbot.init({
95
+ chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f',
96
+ apiHost: 'http://localhost:3000',
97
+ chatflowConfig: {
98
+ // topK: 2
99
+ },
100
+ observersConfig: {
101
+ // (optional) Allows you to execute code in parent based upon signal observations within the chatbot.
102
+ // The userinput field submitted to bot ("" when reset by bot)
103
+ observeUserInput: (userInput) => {
104
+ console.log({ userInput });
105
+ },
106
+ // The bot message stack has changed
107
+ observeMessages: (messages) => {
108
+ console.log({ messages });
109
+ },
110
+ // The bot loading signal changed
111
+ observeLoading: (loading) => {
112
+ console.log({ loading });
113
+ },
114
+ },
115
+ theme: {
116
+ button: {
117
+ backgroundColor: '#3B81F6',
118
+ right: 20,
119
+ bottom: 20,
120
+ size: 48, // small | medium | large | number
121
+ dragAndDrop: true,
122
+ iconColor: 'white',
123
+ customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
124
+ autoWindowOpen: {
125
+ autoOpen: true, //parameter to control automatic window opening
126
+ openDelay: 2, // Optional parameter for delay time in seconds
127
+ autoOpenOnMobile: false, //parameter to control automatic window opening in mobile
128
+ },
129
+ },
130
+ tooltip: {
131
+ showTooltip: true,
132
+ tooltipMessage: 'Hi There 👋!',
133
+ tooltipBackgroundColor: 'black',
134
+ tooltipTextColor: 'white',
135
+ tooltipFontSize: 16,
136
+ },
137
+ disclaimer: {
138
+ title: 'Disclaimer',
139
+ message: 'By using this chatbot, you agree to the <a target="_blank" href="https://flowiseai.com/terms">Terms & Condition</a>',
140
+ textColor: 'black',
141
+ buttonColor: '#3b82f6',
142
+ buttonText: 'Start Chatting',
143
+ buttonTextColor: 'white',
144
+ blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)', //The color of the blurred background that overlays the chat interface
145
+ backgroundColor: 'white',
146
+ },
147
+ customCSS: ``, // Add custom CSS styles. Use !important to override default styles
148
+ chatWindow: {
149
+ showTitle: true,
150
+ showAgentMessages: true,
151
+ title: 'Flowise Bot',
152
+ titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
153
+ welcomeMessage: 'Hello! This is custom welcome message',
154
+ errorMessage: 'This is a custom error message',
155
+ backgroundColor: '#ffffff',
156
+ backgroundImage: 'enter image path or link', // If set, this will overlap the background color of the chat window.
157
+ height: 700,
158
+ width: 400,
159
+ fontSize: 16,
160
+ starterPrompts: ['What is a bot?', 'Who are you?'], // It overrides the starter prompts set by the chat flow passed
161
+ starterPromptFontSize: 15,
162
+ clearChatOnReload: false, // If set to true, the chat will be cleared when the page reloads
163
+ sourceDocsTitle: 'Sources:',
164
+ renderHTML: true,
165
+ botMessage: {
166
+ backgroundColor: '#f7f8ff',
167
+ textColor: '#303235',
168
+ showAvatar: true,
169
+ avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
170
+ },
171
+ userMessage: {
172
+ backgroundColor: '#3B81F6',
173
+ textColor: '#ffffff',
174
+ showAvatar: true,
175
+ avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
176
+ },
177
+ textInput: {
178
+ placeholder: 'Type your question',
179
+ backgroundColor: '#ffffff',
180
+ textColor: '#303235',
181
+ sendButtonColor: '#3B81F6',
182
+ maxChars: 50,
183
+ maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
184
+ autoFocus: true, // If not used, autofocus is disabled on mobile and enabled on desktop. true enables it on both, false disables it on both.
185
+ sendMessageSound: true,
186
+ // sendSoundLocation: "send_message.mp3", // If this is not used, the default sound effect will be played if sendSoundMessage is true.
187
+ receiveMessageSound: true,
188
+ // receiveSoundLocation: "receive_message.mp3", // If this is not used, the default sound effect will be played if receiveSoundMessage is true.
189
+ },
190
+ feedback: {
191
+ color: '#303235',
192
+ },
193
+ dateTimeToggle: {
194
+ date: true,
195
+ time: true,
196
+ },
197
+ footer: {
198
+ textColor: '#303235',
199
+ text: 'Powered by',
200
+ company: 'C-agent',
201
+ companyLink: 'https://cmcts.ai.com',
202
+ },
203
+ },
204
+ },
205
+ });
206
+ </script>
207
+ ```
208
+
209
+ ## (Experimental) Proxy Server Setup
210
+
211
+ The Flowise Embed Proxy Server enhances the security of your chatbot implementation by acting as a protective intermediary layer. This server eliminates the need to expose sensitive Flowise instance details in your frontend code and provides several key security benefits:
212
+
213
+ ![Proxy Server](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/images/proxyserver.png?raw=true)
214
+
215
+ - **Enhanced Security**: Conceals your Flowise API host and chatflow IDs from client-side exposure
216
+ - **Access Control**: Implements strict domain-based restrictions for chatbot embedding
217
+ - **Secure Communication**: Acts as a secure gateway for all interactions between your website and Flowise instance
218
+ - **Authentication Management**: Handles API key authentication securely on the server side, away from client exposure
219
+
220
+ This proxy server can be deployed to any Node.js hosting platform.
221
+
222
+ ## Quick Start
223
+
224
+ 1. Configure environment:
225
+
226
+ ```bash
227
+ # Copy .env.example to .env and configure required settings:
228
+ API_HOST=https://your-flowise-instance.com
229
+ FLOWISE_API_KEY=your-api-key
230
+
231
+ # Configure your chatflows:
232
+ # Format: [identifier]=[chatflowId],[allowedDomain1],[allowedDomain2],...
233
+ #
234
+ # identifier: Any name you choose (e.g., agent1, support, salesbot)
235
+ # chatflowId: The UUID of your Flowise chatflow
236
+ # allowedDomains: Comma-separated list of domains where this chat can be embedded
237
+ #
238
+ # Examples:
239
+ support=abc123-def456,https://example.com
240
+ agent1=xyz789-uvw456,https://sales.example.com
241
+ helpdesk=ghi123-jkl456,https://help.example.com,https://support.example.com
242
+ ```
243
+
244
+ 2. Install dependencies: (assuming you did not run `yarn install` yet)
245
+
246
+ ```bash
247
+ yarn install
248
+ ```
249
+
250
+ 3. Start proxy server:
251
+
252
+ ```bash
253
+ yarn start
254
+ # Server will be available at:
255
+ # - Local: http://localhost:3001
256
+ # - Cloud: [Your Platform URL] (e.g., https://your-app.herokuapp.com)
257
+ ```
258
+
259
+ 4. Once the proxy server is running in production, you will be able to embed your chatbots safely without exposing your Flowise API host and chatflow IDs as below:
260
+
261
+ ```html
262
+ <script type="module">
263
+ import Chatbot from 'your-proxy-server-url/web.js'; // Must be 'your-proxy-server-url/web.js'
264
+ Chatbot.init({
265
+ chatflowid: 'your-identifier-here', // Must match an identifier from your .env
266
+ apiHost: 'your-proxy-server-url', // Must match the URL of your proxy server
267
+ chatflowConfig: {
268
+ // ...
269
+ },
270
+ });
271
+ </script>
272
+ ```
273
+
274
+ 5. (optional) If you want to test any identifier in public/index.html, you can update it as below:
275
+
276
+ ```html
277
+ <!-- public/index.html -->
278
+ chatflowid: 'your-identifier-here' // Must match an identifier from your .env
279
+ ```
280
+
281
+ **Important Notes:**
282
+
283
+ - To ensure secure embedding, you must explicitly whitelist the websites authorized to embed each chatbot. This configuration is done within the .env file. Note that this also applies to your server's URL when deployed to a cloud environment, or http://localhost:3001 for local development, if needed you must whitelist it as well.
284
+ - Wildcard domains (\*) are not supported for security reasons
285
+ - Identifiers are case-insensitive (e.g., 'Support' and 'support' are treated the same)
286
+
287
+ ## Cloud Deployment Requirements
288
+
289
+ When deploying to cloud platforms, you must configure the environment variables directly in your platform. The proxy server will not start without these variables being properly set. Compatible with Nixpacks for automatic deployment configuration.
290
+
291
+ ## Development Mode (For Local Testing)
292
+
293
+ 1. Configure your environment variables (see above)
294
+
295
+ 2. Start the proxy server:
296
+
297
+ ```bash
298
+ yarn start
299
+ # Server will be available at:
300
+ # - Local: http://localhost:3001
301
+ ```
302
+
303
+ 3. Update the test page configuration:
304
+
305
+ - Open `public/index.html` in your code editor
306
+ - Modify the `chatflowid` and `apiHost` to match your `.env` settings:
307
+
308
+ ```html
309
+ <!-- public/index.html -->
310
+ <script type="module">
311
+ import Chatbot from './web.js';
312
+ Chatbot.init({
313
+ chatflowid: 'agent1', // Must match an identifier from your .env
314
+ apiHost: 'http://localhost:3001', // Change this from window.location.origin to 'http://localhost:3001'
315
+ });
316
+ </script>
317
+ ```
318
+
319
+ For full page testing, use this configuration instead:
320
+
321
+ ```html
322
+ <!-- public/index.html -->
323
+ <flowise-fullchatbot></flowise-fullchatbot>
324
+ <script type="module">
325
+ import Chatbot from './web.js';
326
+ Chatbot.initFull({
327
+ chatflowid: 'agent1', // Must match an identifier from your .env
328
+ apiHost: 'http://localhost:3001', // Change this from window.location.origin to 'http://localhost:3001'
329
+ });
330
+ </script>
331
+ ```
332
+
333
+ 4. While the proxy server is running, open a new terminal and start the development server:
334
+
335
+ ```bash
336
+ yarn dev
337
+ # This will serve the test page on http://localhost:5678 automatically
338
+ ```
339
+
340
+ 5. Test the chatbot:
341
+
342
+ - Navigate to http://localhost:5678
343
+ - The chatbot should now be visible and functional
344
+
345
+ **Note:** The development URL (http://localhost:5678) is automatically added to allowed domains in development mode. You don't need to add it manually.
346
+
347
+ ## License
348
+
349
+ Source code in this repository is made available under the [MIT License](https://github.com/FlowiseAI/Flowise/blob/master/LICENSE.md).