Get started
Embed
Add your agent to any website as a chat widget, with a script tag, npm package, or iframe.
Put your agent on your website as a chat widget. Customers start a conversation without leaving the page, and every thread lands in your Inbox.
The widget only loads on domains you add to the allowed list. This stops others from copying your embed code, using up your limits, or reaching your conversations. Add your domains before you embed. See Set up the widget.
Widget styles
Pick the style that fits your site.
Standard button
A chat button that expands into a full chat drawer.
- Chat button with your agent avatar or an animated orb
- Drawer-style chat window
- Glass, white, or black background
- Optional animated border
Floating input
A minimal floating input field that expands into the full chat.
- Floating input field
- Custom accent color
- Expansion animation
- Voice input, if enabled
Set up the widget
Choose a style
Standard button:
- Style: Glass, White, or Black background
- Chat Button Title: the welcome line on the button, for example "Hi, let's chat!"
- Button Avatar: agent avatar or animated orb
- Border: simple or animated gradient
Floating input:
- Accent Color: border, send button, and focus ring color
- Button Avatar: agent avatar or animated orb
- Suggested questions: when the floating input opens, up to three starter questions appear as bubbles. Configure them on the agent: up to four questions, 120 characters each.
Orb animations (both styles): Glint, Orb, Command, Mana, or Halo. Mana, Command, Glint, and Halo accept custom hex colors.
Add allowed domains
- In the Website settings, find Domain Security Settings.
- Click Add Domain and enter your domain, for example
example.com. - For subdomains, use a wildcard:
*.example.com. - Add every domain where the widget will appear.
- Click Save.
Any other domain is blocked and the widget won't appear.
Copy the embed code
The embed code appears once at least one allowed domain is saved. Choose an embedding method, click Copy Code, and paste it into your site.
Embedding Methods
Method 1: Script Tag (Recommended)
Works on any website including WordPress, Shopify, Wix, Squarespace, and custom sites.
<script>
window.chatbotConfig = {
chatbotId: 'your-agent-id',
apiUrl: 'https://dashboard.getlinkai.com'
};
(function() {
var script = document.createElement('script');
script.src = window.chatbotConfig.apiUrl + '/chatbot.js?v=' + Date.now();
document.head.appendChild(script);
})();
</script>
Where to place this code:
- WordPress: Use a custom HTML block or add to your theme's footer
- Shopify: Add to
theme.liquidbefore the closing</body>tag - Wix: Use the "Custom Code" feature in site settings
- Squarespace: Add to Footer Code Injection in site settings
- Custom Sites: Place before the closing
</body>tag
Method 2: NPM Package (React/Next.js)
For React or Next.js applications, use our NPM package:
npm install @linkai/widget
Then import and use the component:
import { LinkAIWidget } from '@linkai/widget';
function App() {
return (
<div>
{/* Your app content */}
<LinkAIWidget agentId="your-agent-id" />
</div>
);
}
Method 3: Direct Iframe Embed
When you need more control over placement:
Button Embed
<iframe
src="https://dashboard.getlinkai.com/embed/your-agent-id/button"
style="position: fixed; bottom: 20px; right: 20px; border: none; width: 400px; height: 600px; z-index: 9999;"
allow="microphone"
></iframe>
Window Embed (Full Chat Interface)
<iframe
src="https://dashboard.getlinkai.com/embed/your-agent-id/window"
style="border: none; width: 100%; height: 600px;"
allow="microphone"
></iframe>
Platform guides
WordPress
- Install a custom HTML plugin (e.g., "Insert Headers and Footers")
- Go to Settings > Insert Headers and Footers
- Paste the embed code in the Footer section
- Save changes
Alternative: Add to your theme's footer.php file before </body>
Shopify
- Go to Online Store > Themes
- Click Actions > Edit code
- Open
theme.liquid - Paste the embed code before the closing
</body>tag - Save changes
Wix
- Go to Settings > Custom Code
- Click + Add Custom Code
- Paste the embed code
- Set placement to Body - End
- Apply to all pages
- Save and publish
Squarespace
- Go to Settings > Advanced > Code Injection
- Paste the embed code in the Footer section
- Save changes
Webflow
- Go to Project Settings > Custom Code
- Paste the embed code in the Footer Code section
- Save and publish
Public agent pages
You can also publish a branded chat page, with no embed snippet required. See Pages.
- URL:
https://pages.getlinkai.com/@your-handle - The page uses your workspace brand (logo and accent) unless you turn brand off
- Assign the agent that should answer
- Edit title, handle, and SEO in Ally's Pages view, then publish
Use a public page when you want a shareable link (bio, ads, QR) instead of a widget on an existing site. Domain allowlisting still applies to the embed widget, not to the public page host.
Widget features
Real-Time Chat
- Instant message delivery
- Typing indicators
- Conversation persistence
Voice Input
Voice mode allows customers to speak to your agent directly from the widget.
- Voice-to-text transcription (if enabled)
- Real-time audio processing
- Multi-language support
File Attachments
- Upload images and documents (if enabled)
- Drag-and-drop support
Mobile Optimization
- Responsive design
- Touch-friendly interface
- Optimized for all screen sizes
Theme Support
The widget automatically detects and synchronizes with your website's light/dark theme.
Programmatic control
Control the widget from your own JavaScript:
Opening the Widget
const widget = document.querySelector('linkai-widget');
if (widget && widget.openChat) {
widget.openChat();
}
Closing the Widget
const widget = document.querySelector('linkai-widget');
if (widget && widget.closeChat) {
widget.closeChat();
}
Listening to Events
window.addEventListener('linkai-widget-opened', () => {
console.log('Widget opened');
});
window.addEventListener('linkai-widget-closed', () => {
console.log('Widget closed');
});
Troubleshooting
Widget Not Appearing
Check Domain Configuration:
- Verify your domain is added to the allowed domains list
- Ensure the domain matches exactly (including
wwwif applicable) - Check browser console for error messages
Check Embed Code:
- Verify the
chatbotIdis correct - Ensure the script is placed before the closing
</body>tag - Check for JavaScript errors in the browser console
Clear Cache:
- Clear your browser cache
- Hard refresh the page (Ctrl+Shift+R or Cmd+Shift+R)
- Try in an incognito/private window
Domain Validation Error
A "Domain validation failed" error means domain security is blocking a domain that isn't on your allowed list.
To Fix:
- Verify the domain is added to your allowed domains list in the dashboard
- Check the exact domain in your browser's address bar. It must match exactly
- If you're using
www, add bothexample.comandwww.example.com - For subdomains, use wildcard notation:
*.example.com - Wait a few minutes after adding domains for changes to propagate
- Clear your browser cache and hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
Common Mistakes:
- Forgetting to include
wwwwhen your site uses it - Using
http://instead ofhttps://in the domain list (only add the domain name, not the protocol) - Typos in the domain name
- Using the widget on a subdomain without wildcard configuration
Voice Features Not Working
- Verify voice is enabled in your agent settings
- Check browser permissions for microphone access
- Ensure you're using HTTPS (voice requires secure context)
- Test in a supported browser (Chrome, Edge, Safari)
Next steps
Set the instructions, persona, and welcome message the widget uses.
Add phone, SMS, WhatsApp, Instagram, and more.
Share a branded chat link instead of embedding.
Track conversations and performance.
Need help? Email support@getlinkai.com.