wakz-chat-widget 2.0.0 → 2.2.0

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.
Files changed (3) hide show
  1. package/README.md +51 -24
  2. package/index.js +305 -413
  3. package/package.json +13 -6
package/README.md CHANGED
@@ -1,43 +1,70 @@
1
1
  # wakz-chat-widget
2
2
 
3
- Production-grade AI chat widget by **WAKZ** — Shadow DOM isolated, zero dependencies, Intercom/Crisp quality.
3
+ **Premium AI chat widget by WAKZ** — A production-grade, self-contained chat widget using Shadow DOM.
4
+
5
+ > Competes with Intercom & Crisp in quality. **Zero external dependencies** — pure vanilla JavaScript.
6
+
7
+ ## Features
8
+
9
+ - Shadow DOM isolation (no CSS conflicts)
10
+ - Multi-language support (English, Arabic, French) with full RTL
11
+ - Device detection (model, platform, type)
12
+ - Online/offline status with animated indicators
13
+ - Message polling with deduplication
14
+ - Mobile responsive (full-screen on small devices)
15
+ - Typing indicator animations
16
+ - Welcome messages
17
+ - Human agent badge support
18
+ - Auto-resizing textarea input
19
+ - Keyboard shortcuts (Enter to send, Shift+Enter for newline, Escape to close)
20
+ - Smooth animations and transitions
21
+ - Configurable theming (colors, position)
4
22
 
5
23
  ## Installation
6
24
 
7
- No installation needed. Add this script tag to your website:
25
+ ```bash
26
+ npm install wakz-chat-widget
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ Copy `index.js` from `node_modules/wakz-chat-widget/` to your public folder and include it:
8
32
 
9
33
  ```html
10
- <!-- WAKZ Chat Widget -->
11
- <script
12
- src="https://unpkg.com/wakz-chat-widget@latest/index.js"
34
+ <script src="/wakz-widget.js"
13
35
  data-api-key="YOUR_API_KEY"
14
- data-server="https://your-wakz-server.com"
36
+ data-server="https://your-server.com"
15
37
  async>
16
38
  </script>
17
39
  ```
18
40
 
19
- Replace:
20
- - `YOUR_API_KEY` — Your WAKZ embed API key
21
- - `https://your-wakz-server.com` — Your WAKZ server URL
41
+ ## Configuration
22
42
 
23
- ## Features
43
+ The widget fetches its configuration from your server's `/api/v1/embed/config` endpoint. Configurable options include:
24
44
 
25
- - **Shadow DOM** Fully isolated from your website's CSS
26
- - **Zero Dependencies** — Pure vanilla JavaScript
27
- - **RTL Support** Full Arabic/Hebrew right-to-left support
28
- - **Dynamic Theming** Colors, position, bot name, welcome message configurable from dashboard
29
- - **Responsive** Full-screen on mobile, floating window on desktop
30
- - **Real-time Chat** AI-powered responses via WAKZ backend
31
- - **Typing Indicator** Smooth animated dots while bot is thinking
32
- - **Session Persistence** Chat history preserved across page reloads
33
- - **Online/Offline Status** Green/red dot with pulse animation
45
+ | Option | Type | Default | Description |
46
+ |--------|------|---------|-------------|
47
+ | `botName` | string | `'WAKZ'` | Bot display name |
48
+ | `welcomeMessage` | string | `''` | Initial welcome message |
49
+ | `primaryColor` | string | `'#171717'` | Primary theme color |
50
+ | `chatBg` | string | `'#f8f9fa'` | Chat area background |
51
+ | `btnColor` | string | `'#171717'` | FAB button color |
52
+ | `widgetBg` | string | `'#ffffff'` | Widget background |
53
+ | `position` | string | `'bottom-right'` | Widget position |
54
+ | `language` | string | `'en'` | Language (`en`, `ar`, `fr`) |
55
+ | `showStatus` | boolean | `true` | Show online/offline dot |
56
+ | `online` | boolean | `true` | Initial status |
34
57
 
35
- ## CDN
58
+ ## Version History
36
59
 
37
- ```html
38
- https://unpkg.com/wakz-chat-widget@latest/index.js
39
- https://cdn.jsdelivr.net/npm/wakz-chat-widget@latest/index.js
40
- ```
60
+ ### v2.2.0
61
+ - Added device model, platform, and type detection (User-Agent Client Hints API + UA fallback)
62
+ - Device info sent with session data for dashboard analytics
63
+
64
+ ### v2.0.0
65
+ - Complete rewrite with Shadow DOM architecture
66
+ - Multi-language support (EN/AR/FR) with RTL
67
+ - Production-grade UI with animations
41
68
 
42
69
  ## License
43
70