Appearance
Live Chat Widget Setup
This guide walks you through integrating the Live Chat widget on your website.
Prerequisites
- Active tenant account
- Website where widget will be embedded
- Widget token (generated in admin settings)
Quick Start
1. Get Widget Token
- Log in to your dashboard
- Open Messaging → Widget Playground
- Click Generate Widget Token
- Copy your tenant ID + the generated token (the Playground can also generate embed code for you)
2. Add Widget Script
Paste this near the end of your site's <body> (or wherever you inject scripts). The widget works on any website, regardless of framework:
html
<!DOCTYPE html>
<html>
<head>
<title>Your Website</title>
</head>
<body>
<!-- Your website content -->
<!-- Chat Widget Script -->
<script src="https://app.autoch.at/web-widget.js"></script>
<script>
ChatWidget.renderWebWidget({
tenantId: "your-tenant-id",
apiUrl: "https://api.yourdomain.com",
token: "your-widget-token",
primaryColor: "#3B82F6",
companyName: "Your Company",
position: "bottom-right"
});
</script>
</body>
</html>3. Configure Widget
Customize the widget appearance:
javascript
ChatWidget.renderWebWidget({
tenantId: 'your-tenant-id',
apiUrl: 'https://api.yourdomain.com',
token: 'your-widget-token',
// Customization
primaryColor: '#3B82F6', // Button and header color
companyName: 'Your Company', // Display name
position: 'bottom-right' // 'bottom-right' or 'bottom-left'
});Note: The widget is also available as renderWebWidget() directly (without the ChatWidget. prefix) for convenience.
React Integration
If using React, import the component directly:
tsx
import { WebWidget } from '@your-package/components/WebWidget';
function App() {
return (
<div>
{/* Your app content */}
<WebWidget
tenantId="your-tenant-id"
apiUrl="https://api.yourdomain.com"
token="your-widget-token"
primaryColor="#3B82F6"
companyName="Your Company"
position="bottom-right"
/>
</div>
);
}Configuration Options
Required Parameters
tenantId- Your tenant IDapiUrl- API base URLtoken- Widget authentication token
Optional Parameters
primaryColor- Widget color (default:#3B82F6)companyName- Company name (default:'Support')position- Widget position (default:'bottom-right')
Widget Behavior
Session Management
- Each visitor gets a unique session ID
- Sessions persist across page loads (stored in browser)
- Conversations are linked to sessions
Message Flow
- Customer types message in widget
- Message sent to the widget chat endpoint (
POST /api/widgets/:tenantId/chat) - AI generates a response using your assistant, training context, and safety rules
- Response displayed in the widget immediately (standard HTTP request/response)
- The dashboard receives live updates via the tenant WebSocket (so your team stays in sync)
Security
Token Security
- Widget tokens are tenant-specific and signed.
- Tokens are designed to be embedded on your website; the safest practice is to use the widget domain allowlist so only your domains can use the token successfully.
- Tokens expire (default: 30 days). Generate a new token if you rotate secrets or want to invalidate old embeds.
HTTPS Requirement
- Widget requires HTTPS in production
- WebSocket connections use WSS
- API endpoints must be HTTPS
Widget Playground
The Widget Playground allows you to test and customize your chat widget before embedding it on your website.
Accessing Widget Playground
- Navigate to Messaging → Widget Playground (or
/messaging/playground) - View live preview of your widget
- Customize widget settings in real-time
- Test widget functionality
Features
- Live Preview: See widget as it will appear on your website
- Real-Time Customization: Change colors, position, greeting instantly
- Test Messaging: Send test messages to verify functionality
- Copy Embed Code: Get widget code ready to paste
Using Widget Playground
- Customize Appearance: Adjust primary color, position, greeting
- Test Widget: Send test messages to verify everything works
- Copy Code: Copy the embed code when ready
- Deploy: Add code to your website
Tip: Use Widget Playground to test different configurations before deploying to production.
Testing
Local Testing
- Use
http://localhostfor development - Widget works on localhost
- WebSocket connections work locally
- Use Widget Playground for testing
Production Testing
- Deploy widget script to production
- Test widget on live website
- Verify messages are received
- Check AI responses are generated
- Use Widget Playground to verify settings
Troubleshooting
Widget Not Loading
- Check script is loaded
- Verify API URL is correct
- Check browser console for errors
- Verify token is valid
Messages Not Sending
- Check API endpoint is accessible
- Verify token authentication
- Review network requests in browser dev tools
- Check API logs for errors
No AI Responses
- Verify assistant is configured
- Check default chat assistant is set
- Review API logs for AI errors (model/provider config, safety blocks, rate limits)
For more troubleshooting help, see Troubleshooting Guide.
Next Steps
- Widget Configuration - Advanced customization
- Conversations Guide - Managing conversations
- API Reference - Programmatic access

