avin-ai 0.1.6 → 0.1.8

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,150 +1,85 @@
1
- # AvinAI ConvAI Widget Embed
1
+ # AvinAI Widget SDK
2
2
 
3
- Embeddable voice conversation widget for AvinAI agents. Add AI-powered voice conversations to any website with just 2 lines of code.
3
+ A lightweight widget SDK for integrating AvinAI voice and chat assistants into any website.
4
4
 
5
- ## 🚀 Quick Start
5
+ ## Installation
6
6
 
7
- Add the widget to your website:
8
-
9
- ```html
10
- <!-- Step 1: Add the widget element with your agent ID -->
11
- <avin-convai id="YOUR_AGENT_ID"></avin-convai>
12
-
13
- <!-- Step 2: Load the widget script -->
14
- <script src="https://unpkg.com/@avinai/convai-widget-embed" async type="text/javascript"></script>
7
+ ### NPM
8
+ ```bash
9
+ npm install avin-ai
15
10
  ```
16
11
 
17
- That's it! The voice assistant will appear as a floating button on your website.
18
-
19
- ## 📋 Features
20
-
21
- - ✅ **Easy Integration** - Just 2 lines of code
22
- - ✅ **Voice Conversations** - WebRTC-powered real-time voice
23
- - ✅ **Customizable** - Multiple configuration options
24
- - ✅ **Responsive** - Works on desktop and mobile
25
- - ✅ **Zero Dependencies** - Self-contained web component
26
-
27
- ## 🎨 Configuration
28
-
29
- Customize the widget with attributes:
30
-
12
+ ### CDN
31
13
  ```html
32
- <avin-convai
33
- id="YOUR_AGENT_ID"
34
- position="bottom-right"
35
- primary-color="#6366f1"
36
- server-url="https://your-server.com"
37
- ></avin-convai>
14
+ <script src="https://unpkg.com/avin-ai@latest/dist/avin-ai.js" widget-id="YOUR_WIDGET_ID" defer></script>
38
15
  ```
39
16
 
40
- ### Available Attributes
17
+ ## Widget Modes
41
18
 
42
- | Attribute | Type | Default | Description |
43
- |-----------|------|---------|-------------|
44
- | `id` | string | *required* | Your AvinAI agent ID |
45
- | `position` | string | `bottom-right` | Widget position: `bottom-right`, `bottom-left`, `top-right`, `top-left` |
46
- | `primary-color` | string | `#6366f1` | Primary color for the widget (hex format) |
47
- | `server-url` | string | auto | Custom server URL for API calls |
19
+ | Mode | Description |
20
+ |------|-------------|
21
+ | `voice_only` | Voice call with transcript |
22
+ | `chat_voice` | Chat interface with voice button |
23
+ | `avatar_only` | AI avatar video call |
24
+ | `chat_avatar` | Chat + avatar video |
48
25
 
49
- ## 📖 Examples
26
+ ## Local Development
50
27
 
51
- ### Basic Usage
52
- ```html
53
- <avin-convai id="63c510f4-b98a-435c-ad22-aa1e042d1d92"></avin-convai>
54
- <script src="https://unpkg.com/@avinai/convai-widget-embed" async type="text/javascript"></script>
28
+ ### 1. Install dependencies
29
+ ```bash
30
+ cd sdk
31
+ npm install
55
32
  ```
56
33
 
57
- ### Custom Position and Color
58
- ```html
59
- <avin-convai
60
- id="63c510f4-b98a-435c-ad22-aa1e042d1d92"
61
- position="bottom-left"
62
- primary-color="#10b981"
63
- ></avin-convai>
64
- <script src="https://unpkg.com/@avinai/convai-widget-embed" async type="text/javascript"></script>
34
+ ### 2. Build the SDK
35
+ ```bash
36
+ npm run build
65
37
  ```
66
38
 
67
- ### With Custom Server
68
- ```html
69
- <avin-convai
70
- id="63c510f4-b98a-435c-ad22-aa1e042d1d92"
71
- server-url="https://your-custom-server.com"
72
- ></avin-convai>
73
- <script src="https://unpkg.com/@avinai/convai-widget-embed" async type="text/javascript"></script>
74
- ```
39
+ ### 3. Test locally
75
40
 
76
- ## 🔧 Advanced Usage
41
+ Create a test HTML file:
77
42
 
78
- ### Using Specific Version
79
43
  ```html
80
- <script src="https://unpkg.com/@avinai/convai-widget-embed@1.0.0" async type="text/javascript"></script>
44
+ <!doctype html>
45
+ <html lang="en">
46
+ <head>
47
+ <meta charset="UTF-8">
48
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
49
+ <title>Widget Test</title>
50
+ </head>
51
+ <body>
52
+ <h1>Widget Local Test</h1>
53
+ <p>The widget should appear in the bottom-right corner.</p>
54
+
55
+ <!-- Load from local build -->
56
+ <script src="./dist/avin-ai.js" widget-id="YOUR_WIDGET_ID" defer></script>
57
+ </body>
58
+ </html>
81
59
  ```
82
60
 
83
- ### Self-Hosting
84
- Download and host the widget yourself:
85
-
61
+ ### 4. Serve the files
86
62
  ```bash
87
- npm install @avinai/convai-widget-embed
63
+ npx serve .
88
64
  ```
89
65
 
90
- Then include from your own server:
91
- ```html
92
- <script src="/path/to/widget.js" type="module"></script>
93
- ```
94
-
95
- ## 🌐 Browser Support
96
-
97
- - Chrome / Edge (latest)
98
- - Firefox (latest)
99
- - Safari (latest)
100
- - Mobile browsers (iOS Safari, Chrome Android)
101
-
102
- **Requirements:**
103
- - WebRTC support
104
- - Microphone access
66
+ Open `http://localhost:3000/test_widget.html` in your browser.
105
67
 
106
- ## 📱 Mobile Support
107
-
108
- The widget is fully responsive and works on mobile devices. Users will be prompted to grant microphone permission on first use.
109
-
110
- ## 🔒 Security & Privacy
111
-
112
- - HTTPS required for microphone access
113
- - User must explicitly grant microphone permission
114
- - All voice data is transmitted via secure WebRTC
115
- - No data is stored by the widget
116
-
117
- ## 🛠️ Development
68
+ ## Publishing
118
69
 
119
70
  ```bash
120
- # Clone the repository
121
- git clone https://github.com/Alok7268/hr-dashboard.git
122
- cd sdk
71
+ # Bump version in package.json
72
+ npm version patch
123
73
 
124
- # Install dependencies
125
- npm install
126
-
127
- # Start dev server
128
- npm run dev
129
-
130
- # Build for production
74
+ # Build and publish
131
75
  npm run build
76
+ npm publish --access public
132
77
  ```
133
78
 
134
- ## 📄 License
135
-
136
- MIT
137
-
138
- ## 🤝 Support
139
-
140
- For support, please visit [AvinAI Dashboard](https://your-dashboard.com) or contact support@avinai.com
141
-
142
- ## 🔗 Links
143
-
144
- - [Documentation](https://docs.avinai.com)
145
- - [Dashboard](https://your-dashboard.com)
146
- - [GitHub](https://github.com/Alok7268/hr-dashboard)
147
-
148
- ---
79
+ ## Configuration Attributes
149
80
 
150
- Made with ❤️ by AvinAI
81
+ | Attribute | Description |
82
+ |-----------|-------------|
83
+ | `widget-id` | Widget ID from dashboard (required) |
84
+ | `position` | `bottom-right`, `bottom-left`, `top-right`, `top-left` |
85
+ | `primary-color` | Hex color (e.g., `#6366f1`) |