Web Widget Platform
Complete Integration & Customization Guide
The Fonada Web Widget Platform enables businesses to deploy intelligent AI-powered chat and voice assistants directly on websites with minimal setup. The platform supports no-code embedding, advanced customization, real-time conversations, analytics tracking, and third-party integrations.
The widget is designed to improve customer engagement, automate support operations, increase lead conversion, and deliver seamless conversational experiences across desktop and mobile devices.
Core Capabilities
- AI-powered website chat widget
- Voice-enabled conversational support
- Custom branding and UI personalization
- Real-time session management
- Quick reply buttons and CTA actions
- Conversation analytics and KPI tracking
- Mobile responsive and lightweight embedding
- API-based backend integrations
Widget Types
Fonada supports two primary widget configurations. The widget type is controlled using the channel parameter when creating an agent.
| type | channel | features | bestFor |
|---|---|---|---|
| Text Widget | chatbot | Fast text-only chat experience | FAQs, support, e-commerce |
| Voice Widget | web_widget | Voice + text interaction | Premium support, accessibility |
Getting Started
Setting up the Fonada Web Widget requires only a few steps. The platform automatically manages session handling, message rendering, AI responses, and browser storage.
- Authenticate using the Fonada API.
- Create a widget agent.
- Save agent_id and agent_key.
- Customize widget appearance and behavior.
- Embed the widget script into your website.
- Start receiving live AI conversations.
Authentication
All JWT-authenticated operations require an access token obtained from the authentication endpoint.
Endpoint: POST /auth/v1/token?grant_type=password
curl -X POST "https://app.fonada.ai/auth/v1/token?grant_type=password" \
-H "apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{"email": "you@email.com", "password": "yourpassword"}'Widget Setup
Fonada supports both Text Widgets and Voice Widgets. Configure the agent payload based on your chosen channel.
Text Widget Example
{
"channel": "chatbot",
"llm_provider": "openai",
"llm_model": "gpt-4o",
"system_prompt": "You are a helpful assistant."
}Voice Widget Example
{
"channel": "web_widget",
"tts_provider": "fonadalabs",
"stt_provider": "fonadalabs",
"voice": "Mayra"
}Widget Customization
The widget can be fully customized to match your business branding and user experience requirements.
- Custom button colors
- Header styling
- Message bubble colors
- Dark and light themes
- Widget positioning
- Custom CTA icons
- Custom logos
- Font customization
Recommended Design Guidelines
- Use brand colors consistently
- Maintain WCAG-compliant contrast ratios
- Place the widget in the bottom-right corner
- Avoid overlapping forms and navigation menus
- Use optimized PNG or SVG logos
Widget Embedding
Embedding the widget requires only a single script tag placed before the closing </body> tag.
<script src="https://app.fonada.ai/functions/v1/widget?agent_id=agent_uuid_789&agent_key=sk_live_widget_xyz123"></script>
Once embedded, the widget automatically initializes conversations, renders messages, handles sessions, and processes AI responses.
Programmatic Controls
The widget exposes JavaScript APIs that allow developers to control widget behavior programmatically:
- Open and close widget dynamically
- Send messages from JavaScript
- Clear conversation sessions
- Attach custom user information
- Listen for AI message events
Interactive Features
Quick Reply Buttons
Quick reply buttons improve engagement by allowing users to start predefined workflows instantly.
| field | required | purpose |
|---|---|---|
| id | Yes | Unique identifier |
| label | Yes | Button label |
| prompt | Yes | AI message sent |
| icon | No | Optional emoji |
| order | Yes | Display order |
Welcome Messages
Welcome messages are displayed when the widget opens for the first time. Keep welcome text short, conversational, and action-oriented.
Session & Chat Management
- Sessions auto-create on first message
- Sessions auto-expire after inactivity
- Conversation history stored in localStorage
- Cross-tab synchronization supported
- Headless API chat supported
Analytics & Reporting
Fonada provides detailed widget analytics to visualize user engagement and business performance.
| metric | description |
|---|---|
| total_impressions | Widget impressions on website |
| widget_opens | Total widget opens |
| conversion_rate | Open to impression ratio |
| avg_session_duration | Average session duration |
| unique_users | Distinct engaged users |
| response_time | AI response performance |
Widget Management
Advanced users can upload fully customized widget.js implementations using the widget upload manager.
- Upload custom widget files
- Manage widget version history
- Track upload timestamps
- Maintain multiple widget versions
Error Handling & Debugging
| error | cause | resolution |
|---|---|---|
| Widget not loading | Invalid script URL | Verify script source |
| No AI response | Inactive agent | Check credits and status |
| CORS error | Domain restrictions | Whitelist allowed domains |
| Slow responses | Large prompts | Reduce token usage |
Best Practices
- Load script before closing body tag
- Optimize logo images under 100 KB
- Use responsive layouts for mobile
- Use GPT-4o-mini for lightweight use cases
- Track conversation analytics regularly
- Test on multiple browsers and devices
Framework Integration Examples
| framework | approach |
|---|---|
| React | Widgets can be dynamically loaded using useEffect and script injection. |
| Next.js | Use the next/script component with lazyOnload strategy. |
| Shopify | Embed the widget inside theme.liquid before the closing body tag. |
| WordPress | Add the widget script inside footer.php or use a custom plugin. |
API Reference Summary
| endpoint | method | auth | purpose |
|---|---|---|---|
| /widget | GET | Public | Embeddable widget |
| /save_widget_customization | POST | JWT | Save widget settings |
| /widget_analytics | POST | JWT | Analytics reporting |
| /agent_chat | POST | Agent Key | AI messaging |
Conclusion
The Fonada Web Widget Platform provides a complete enterprise-grade solution for deploying AI-powered conversational experiences on websites. With advanced customization, analytics, session handling, and framework integrations, businesses can rapidly build scalable customer engagement systems while maintaining high performance, flexibility, and user experience standards.