@vanira/sdk
v0.0.6
Published
Vanira Voice & Chat Widget SDK — embed conversational AI into any website with one script tag
Maintainers
Readme
AvinAI Widget SDK
A lightweight widget SDK for integrating AvinAI voice and chat assistants into any website.
Installation
NPM
npm install vanira-aiCDN
<script src="https://unpkg.com/vanira-ai@latest/dist/vanira-ai.js" widget-id="YOUR_WIDGET_ID" defer></script>Widget Modes
| Mode | Description |
|------|-------------|
| voice_only | Voice call with transcript |
| chat_voice | Chat interface with voice button |
| avatar_only | AI avatar video call |
| chat_avatar | Chat + avatar video |
Local Development
1. Install dependencies
cd sdk
npm install2. Build the SDK
npm run build3. Test locally
Create a test HTML file:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Widget Test</title>
</head>
<body>
<h1>Widget Local Test</h1>
<p>The widget should appear in the bottom-right corner.</p>
<!-- Load from local build -->
<script src="./dist/vanira-ai.js" widget-id="YOUR_WIDGET_ID" defer></script>
</body>
</html>4. Serve the files
npx serve .Open http://localhost:3000/test_widget.html in your browser.
Publishing
# Bump version in package.json
npm version patch
# Build and publish
npm run build
npm publish --access publicConfiguration Attributes
| Attribute | Description |
|-----------|-------------|
| widget-id | Widget ID from dashboard (required) |
| position | bottom-right, bottom-left, top-right, top-left |
| primary-color | Hex color (e.g., #6366f1) |
