Quick Start
Add these lines to your HTML:Installation Options
CDN (unpkg)
CDN (jsDelivr)
Self-hosted
Download the files and host them yourself:Initialization
JavaScript API
Data Attributes (Auto-initialization)
Use data attributes for simpler setup:Authentication Options
Direct API (Bearer Token)
Proxy Mode
When your backend handles authentication:Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
baseUrl | string | - | Cuadra API URL |
proxyUrl | string | - | Proxy URL for backend auth |
sessionToken | string | - | Bearer token |
modelId | string | - | Model ID |
mode | string | 'multiChat' | 'singleChat' or 'multiChat' |
modelMode | string | 'fixed' | 'fixed' or 'selector' |
theme | string | 'system' | 'light', 'dark', or 'system' |
showThemeToggle | boolean | true | Show theme toggle button |
language | string | - | Locale code (e.g., 'en', 'es') |
welcomeTitle | string | - | Welcome screen title |
welcomeSubtitle | string | - | Welcome screen subtitle |
suggestions | array | - | Array of { prompt: string } |
containerId | string | 'cuadra-chat' | Target container ID |
enableReasoning | boolean | false | Show AI thinking process |
enableAttachments | boolean | false | Enable file uploads |
Dynamic Token Updates
Update the session token without re-initializing:Full Example
Basic Implementation
Embedded in Existing Page
With Proxy Backend
Styling & Customization
Container Sizing
The widget fills its container. Control size via the container:Custom Styling
Override CSS variables:WordPress Integration
Add to your theme’sfooter.php or use a custom HTML block:
Troubleshooting
Widget Not Appearing
- Check the container exists:
document.getElementById('cuadra-chat') - Ensure CSS is loaded before the script
- Check browser console for errors
- Verify container has explicit height
Authentication Errors
- Check session token is valid
- Verify API key has correct permissions
- Use browser Network tab to inspect requests
Styling Issues
- Ensure CSS file is loaded
- Check for CSS conflicts with your site
- Use browser DevTools to inspect elements
Next Steps
React Components
Use native React components for more control
API Reference
Build custom chat implementations