Chat Clients: Full Interface vs Embeddable Widget
Your AI agent can be accessed through two different chat clients, each designed for different use cases. This guide explains both options and helps you choose the right approach.
Overview
| Client | Best For | Access Method |
|---|---|---|
| Full Chat Interface | Primary destination, power users | Direct URL link |
| Embeddable Widget | Website integration, contextual help | JavaScript embed |
Both clients support text chat, voice conversations, and all AI features.
Full Chat Interface
The full chat interface is a complete, standalone web application for interacting with your AI assistant.
Access URL
https://xinfer.ai/t/your-subdomain
Or for a specific conversation:
https://xinfer.ai/t/your-subdomain/chat/[chat-id]
Page Layout
Desktop View:
| Area | Location | Contents |
|---|---|---|
| Header | Top | Logo, Title, Trash, New Chat, Voice button, User Avatar |
| Sidebar | Left | Chat history grouped by date (Today, Yesterday, Last 7 Days, etc.) |
| Chat Area | Center | Messages, AI responses, product cards |
| Input Area | Bottom | Attach button, text input, voice button, send button |
Mobile View:
| Feature | Behavior |
|---|---|
| Sidebar | Collapsible via hamburger menu |
| Input | Fixed at bottom, touch-friendly |
| Header | Compact with essential actions |
Key Features
Sidebar
| Element | Description |
|---|---|
| Logo & Title | Your branding from app config |
| Trash Icon | Delete all chat history |
| Plus Icon | Start a new conversation |
| Chat History | Grouped by Today, Yesterday, Last 7 Days, Last 30 Days, Older |
Chat Area
| Feature | Description |
|---|---|
| Welcome Message | Greeting configured in setup |
| Suggested Actions | Quick-start prompts (6 on desktop, 3 on mobile) |
| AI Responses | Markdown formatted with code highlighting |
| Product Cards | Rich recommendations with images and prices |
| Citations | References to source content [r-1], [s-2] |
| Voting | Thumbs up/down on AI responses |
Input Area
| Button | Function |
|---|---|
| Attach | Upload images, PDFs, text files |
| Voice | Switch to voice conversation mode |
| Model Select | Choose AI model (if enabled) |
| Send | Submit message (or press Enter) |
| Stop | Cancel AI generation mid-stream |
Keyboard Shortcuts
| Key | Action |
|---|---|
| Enter | Send message |
| Shift+Enter | New line in input |
| Escape | Stop AI generation |
URL Parameters
| URL Pattern | Purpose |
|---|---|
/t/subdomain | New chat |
/t/subdomain/chat/[id] | Resume specific chat |
/t/subdomain/voice | Voice-only page |
/t/subdomain?query=text | Pre-filled first message |
User Types
Guest Users:
- Can chat if guest permission is enabled
- Session-based history (not persistent)
- See login/signup prompts
Logged-in Users:
- Persistent chat history across sessions
- Can vote on responses
- Profile and preferences saved
Admin Users:
- "Admin Mode" to view any user's chats
- Access to admin panel from menu
Embeddable Widget
The chat widget is a floating button and panel that can be embedded on any website.
Basic Installation
Add one line to your website:
<script src="https://xinfer.ai/t/[your-workspace]/widget.js" async></script>
Replace [your-workspace] with your workspace subdomain (e.g., mycompany).
Place before the closing </body> tag.
Important: The widget URL must include /t/[workspace]/. URLs like /embed.js or /widget.js without the tenant path do not exist.
Widget Appearance
Collapsed: Floating chat button in corner Expanded: Chat panel with full conversation interface
Default position: bottom-right corner
Configuration Options
Data Attributes Method
<script
src="https://xinfer.ai/t/your-subdomain/widget.js"
data-customer-id="12345"
data-customer-name="John Doe"
data-customer-email="john@example.com"
data-customer-phone="+1-555-123-4567"
data-position="bottom-right"
async
></script>
JavaScript Configuration Method
<script>
window.XinferChat = {
customerId: '12345',
customerName: 'John Doe',
customerEmail: 'john@example.com',
customerPhone: '+1-555-123-4567',
position: 'bottom-left',
onReady: function() {
console.log('Chat widget is ready');
}
};
</script>
<script src="https://xinfer.ai/t/your-subdomain/widget.js" async></script>
JavaScript configuration takes precedence over data attributes.
Available Options
| Option | Data Attribute | JS Property | Description |
|---|---|---|---|
| Customer ID | data-customer-id | customerId | Links chat to your customer record |
| Customer Name | data-customer-name | customerName | Pre-fills follow-up forms |
| Customer Email | data-customer-email | customerEmail | Pre-fills follow-up forms |
| Customer Phone | data-customer-phone | customerPhone | Pre-fills follow-up forms |
| Position | data-position | position | bottom-right or bottom-left |
| Ready Callback | - | onReady | Function called when widget loads |
Programmatic Control
After the widget loads, you can control it via JavaScript:
// Open the widget
window.XinferChat.open();
// Close the widget
window.XinferChat.close();
// Toggle open/closed
window.XinferChat.toggle();
Widget Features
| Feature | Description |
|---|---|
| Text Chat | Full conversation with AI |
| Voice Chat | Click microphone for voice mode |
| Product Cards | Rich product recommendations |
| Follow-Up Forms | Capture leads when human help needed |
| Auto-Prompt Bubble | Speech bubble to encourage engagement |
Admin Configuration
Configure in Admin > App Config under the embed section:
{
"embed": {
"enabled": true,
"allowedDomains": ["yoursite.com", "*.yoursite.com", "localhost"],
"theme": {
"primaryColor": "#6366f1",
"position": "bottom-right",
"borderRadius": 16
},
"autoPromptCount": 3
}
}
| Setting | Description |
|---|---|
enabled | Turn widget on/off |
allowedDomains | Whitelist of domains that can embed |
theme.primaryColor | Button and accent color (hex) |
theme.position | Default position |
theme.borderRadius | Corner radius in pixels |
autoPromptCount | Times to show engagement bubble (0 = off) |
Domain Whitelist
Only whitelisted domains can load the widget:
{
"allowedDomains": [
"example.com", // Exact match
"*.example.com", // All subdomains
"localhost" // Local development
]
}
Comparison: Full Chat vs Widget
| Aspect | Full Chat | Widget |
|---|---|---|
| Deployment | Link sharing | Code embed |
| Screen Space | Full page | Corner panel |
| Chat History | Sidebar with history | Current session |
| Branding | Full logo and title | Compact |
| Best For | Dedicated support portal | Contextual website help |
| User Login | Full auth options | Guest or linked customer |
| File Attachments | Yes | Yes |
| Voice Chat | Yes | Yes |
When to Use Full Chat
- As your primary AI support destination
- When users need full conversation history
- For complex, multi-session interactions
- When you want users to log in and track history
When to Use Widget
- Add AI help to existing website
- E-commerce product assistance
- Contextual help on specific pages
- Lead capture without leaving your site
Advanced Integration
Customer Identity Linking
Pass your customer ID to link conversations:
<script
src="https://xinfer.ai/t/your-subdomain/widget.js"
data-customer-id="CRM-12345"
async
></script>
Benefits:
- Match chat conversations to CRM records
- Track customer interactions in analytics
- Pre-populate context for the AI
- Include customer data in follow-up requests
Technical Details
Widget Loading Flow
- Page loads
widget.jsfrom your tenant URL - Loader extracts tenant and data attributes
- Main widget bundle loads from
/embed/widget.js - Widget fetches config from
/t/tenant/embed/config - Guest session initialized via
/t/tenant/api/auth/guest - Widget renders and is ready
Storage
Widget localStorage keys (prefixed with xinfer_{tenant}_):
- Chat ID for conversation continuity
- Messages for offline persistence
- Auto-prompt shown count
Full chat uses both localStorage and server-side persistence for logged-in users.
Cross-Origin Sessions
For session sharing between widget and full chat:
- HTTPS required on both sites
- Cookies use
SameSite=None; Secure - User can log in on main site, see same session in widget
Shadow DOM Isolation
The widget creates its own shadow DOM to prevent CSS conflicts with your website. This ensures consistent appearance regardless of your site's styles.
Z-Index
Widget uses z-index: 2147483647 (maximum) to appear above all other content.
Voice Chat
Both clients support voice conversations powered by Hume AI.
How It Works
- Click the microphone/voice button
- Grant microphone permission when prompted
- Connection establishes with Hume AI
- Speak naturally - AI responds with voice
- Click "End Call" to return to text
Requirements
- Modern browser (Chrome, Firefox, Safari, Edge)
- Microphone permission
- HTTPS connection
- Voice enabled in app config
Voice Messages
Voice conversations are automatically transcribed and saved to chat history, so users can review what was discussed.
Access Control
Permission Levels
Configure in Admin > App Config:
| Setting | Who Can Access |
|---|---|
guest | Anyone (no login required) |
login | Registered users only |
user | Users with confirmed email |
Email Confirmation
If chatPermission is "user" and email isn't confirmed:
- Chat shows confirmation message
- Link to resend confirmation
- Must verify email to continue
Troubleshooting
Widget Not Loading
- Check browser console for errors
- Verify domain is in
allowedDomains - Ensure
embed.enabledis true - Confirm script URL is correct
"Domain not allowed" Error
Add your domain to embed.allowedDomains:
- Include production domain
- Include staging/preview domains
- Add
localhostfor development
Customer Data Not Pre-filling
- Use correct attribute names (
data-customer-name, notdata-name) - Ensure values aren't empty strings
- Load script with
asyncattribute
Voice Not Working
- Check microphone permission is granted
- Verify browser supports WebRTC
- Ensure voice is enabled in app config
- Try a different browser (Chrome recommended)
Chat History Missing
- Guest users: History is session-only
- Must be logged in for persistent history
- Try refreshing the page
Summary
| Need | Solution |
|---|---|
| Dedicated support portal | Full Chat Interface |
| Website integration | Embeddable Widget |
| Both options | Use full chat as link destination, widget for contextual help |
Both clients provide the same AI capabilities - choose based on how users will access your AI assistant.
Related Pages
- Integration - Get embed codes and URLs
- App Config - Configure chat settings
- Text Prompts - Customize AI behavior
- Voice Prompts - Configure voice responses
- Follow-Ups - Manage human assistance requests