@vanira/sdk 0.0.82

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 ADDED
@@ -0,0 +1,87 @@
1
+ # Vanira SDK
2
+
3
+ Embed live AI voice + chat on any website.
4
+
5
+ **→ [Integration guide](./INTEGRATION.md)** — embed (script tag) vs npm (your UI, no widget).
6
+
7
+ ## Installation
8
+
9
+ ### NPM
10
+ ```bash
11
+ npm install @vanira/sdk
12
+ ```
13
+
14
+ ### CDN
15
+ ```html
16
+ <script src="https://unpkg.com/vanira-ai@latest/dist/vanira-ai.js" widget-id="YOUR_WIDGET_ID" defer></script>
17
+ ```
18
+
19
+ ## Widget Modes
20
+
21
+ | Mode | Description |
22
+ |------|-------------|
23
+ | `voice_only` | Voice call with transcript |
24
+ | `chat_voice` | Chat interface with voice button |
25
+ | `avatar_only` | AI avatar video call |
26
+ | `chat_avatar` | Chat + avatar video |
27
+
28
+ ## Local Development
29
+
30
+ ### 1. Install dependencies
31
+ ```bash
32
+ cd sdk
33
+ npm install
34
+ ```
35
+
36
+ ### 2. Build the SDK
37
+ ```bash
38
+ npm run build
39
+ ```
40
+
41
+ ### 3. Test locally
42
+
43
+ Create a test HTML file:
44
+
45
+ ```html
46
+ <!doctype html>
47
+ <html lang="en">
48
+ <head>
49
+ <meta charset="UTF-8">
50
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
51
+ <title>Widget Test</title>
52
+ </head>
53
+ <body>
54
+ <h1>Widget Local Test</h1>
55
+ <p>The widget should appear in the bottom-right corner.</p>
56
+
57
+ <!-- Load from local build -->
58
+ <script src="./dist/vanira-ai.js" widget-id="YOUR_WIDGET_ID" defer></script>
59
+ </body>
60
+ </html>
61
+ ```
62
+
63
+ ### 4. Serve the files
64
+ ```bash
65
+ npx serve .
66
+ ```
67
+
68
+ Open `http://localhost:3000/test_widget.html` in your browser.
69
+
70
+ ## Publishing
71
+
72
+ ```bash
73
+ # Bump version in package.json
74
+ npm version patch
75
+
76
+ # Build and publish
77
+ npm run build
78
+ npm publish --access public
79
+ ```
80
+
81
+ ## Configuration Attributes
82
+
83
+ | Attribute | Description |
84
+ |-----------|-------------|
85
+ | `widget-id` | Widget ID from dashboard (required) |
86
+ | `position` | `bottom-right`, `bottom-left`, `top-right`, `top-left` |
87
+ | `primary-color` | Hex color (e.g., `#6366f1`) |