@moveo-ai/web-client 0.86.2 → 0.87.0-true.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.
package/README.md CHANGED
@@ -10,11 +10,26 @@
10
10
 
11
11
  ## 📦 Getting Started
12
12
 
13
+ ### Chat Widget Integration
14
+
13
15
  1. Create an account on https://console.moveo.ai
14
- 1. Create an environment
15
- 1. Create a web integration
16
- 1. Copy the snippet to your website html
17
- 1. Enjoy 🚀
16
+ 2. Create an environment
17
+ 3. Create a web integration
18
+ 4. Copy the snippet to your website html
19
+ 5. Enjoy 🚀
20
+
21
+ ### Audio Widget Integration
22
+
23
+ Add voice calling capabilities to your website:
24
+
25
+ ```html
26
+ <script src="https://cdn.moveo.ai/audio-client.min.js"></script>
27
+ <script>
28
+ window.addEventListener('load', async function () {
29
+ const controller = await MoveoAudio.init({ integrationId: 'YOUR_INTEGRATION_ID' });
30
+ });
31
+ </script>
32
+ ```
18
33
 
19
34
  ## 🛠 Development
20
35
 
@@ -35,9 +50,11 @@ npm install
35
50
  The web-client can be run in different modes depending on your development needs:
36
51
 
37
52
  #### Development Mode
53
+
38
54
  ```bash
39
55
  npm start
40
56
  ```
57
+
41
58
  This starts the webpack dev server on https://localhost:8880 with hot module replacement enabled.
42
59
 
43
60
  #### Local Testing with Different Environments
@@ -49,6 +66,7 @@ When running locally, you can specify which Moveo Channels backend to connect to
49
66
  - **Custom Backend**: Add `?host=YOUR_BACKEND_URL` to test against different environments
50
67
 
51
68
  Example URLs:
69
+
52
70
  ```
53
71
  https://localhost:8880/?integration_id=YOUR_ID&host=https://channels.moveo.ai # Production
54
72
  https://localhost:8880/?integration_id=YOUR_ID&host=https://dev-channels.moveo.ai # Dev
@@ -68,6 +86,55 @@ npm run build:dev
68
86
  npm run watch
69
87
  ```
70
88
 
89
+ ### 📦 Library Exports
90
+
91
+ The build process generates multiple UMD libraries for different use cases:
92
+
93
+ #### Chat Widget (`MoveoAI`)
94
+
95
+ - **`web-client.min.js`** (40KB) - Loader script for the chat widget
96
+ - **`iframe.v2.min.js`** (1.3MB) - Chat widget iframe (v2, current)
97
+ - **`iframe.min.js`** (1.2MB) - Chat widget iframe (v1, deprecated)
98
+
99
+ **Usage**:
100
+
101
+ ```html
102
+ <script src="https://cdn.moveo.ai/web-client.min.js"></script>
103
+ <script>
104
+ MoveoAI.init({ integrationId: 'your-id' });
105
+ </script>
106
+ ```
107
+
108
+ #### Audio Widget (`MoveoAudio`)
109
+
110
+ - **`audio-client.min.js`** (341KB) - Voice widget with Twilio integration
111
+
112
+ **Usage**:
113
+
114
+ ```html
115
+ <script src="https://cdn.moveo.ai/audio-client.min.js"></script>
116
+ <script>
117
+ const controller = await MoveoAudio.init({ integrationId: 'your-id' });
118
+ </script>
119
+ ```
120
+
121
+ **Module Bundler Usage** (webpack, vite, etc.):
122
+
123
+ ```typescript
124
+ // Chat widget
125
+ import MoveoAI from '@moveo-ai/web-client';
126
+ MoveoAI.init({ integrationId: 'your-id' });
127
+
128
+ // Audio widget
129
+ import MoveoAudio, {
130
+ AudioController,
131
+ AudioConfig,
132
+ } from '@moveo-ai/web-client/audio-client.min.js';
133
+ const controller: AudioController = await MoveoAudio.init({
134
+ integrationId: 'your-id',
135
+ });
136
+ ```
137
+
71
138
  ### Testing
72
139
 
73
140
  ```bash
@@ -115,6 +182,7 @@ npm run build-storybook
115
182
  ### Current: Cloudflare Pages
116
183
 
117
184
  The web-client is currently deployed to **Cloudflare Pages**, providing:
185
+
118
186
  - Global CDN distribution
119
187
  - Automatic deployments from GitHub
120
188
  - Preview deployments for pull requests
@@ -129,6 +197,7 @@ The project was originally deployed on Vercel but has been migrated to Cloudflar
129
197
  The production build is automatically deployed when changes are pushed to the `main` branch. Preview deployments are created for pull requests to the `next` branch.
130
198
 
131
199
  Build settings:
200
+
132
201
  - Build command: `npm run build`
133
202
  - Build output directory: `dist`
134
203
  - Node version: 16+