Embed

Embed your Link AI chat widget directly on your website to provide instant customer support, lead generation, and automated conversations.

Embedding Your Chat Widget

Embed your Link AI chat widget directly on your website to provide instant customer support, lead generation, and automated conversations. Choose between two widget styles and get up and running in minutes.

Security Notice: Link AI includes mandatory domain whitelisting to protect your business. You must configure allowed domains before your widget will load. This prevents unauthorized use, protects your usage limits, and secures your users' information. Jump to Security Configuration

Widget Styles

Link AI offers two widget styles to match your website's design:

Standard Button Widget

A traditional chat button that expands into a full chat interface when clicked.

Standard Button Widget

Features:

  • Customizable chat button with agent avatar or animated orb
  • Expandable drawer-style chat interface
  • Glass, white, or black background styles
  • Optional animated borders

Floating Input Widget

A modern, minimalist floating input field that expands into a full chat interface.

Floating Input Widget

Features:

  • Sleek floating input field design
  • Customizable accent colors
  • Smooth expansion animations
  • Voice input support (if enabled)

Quick Start

Step 1: Configure Your Widget

  1. Navigate to Dashboard > Agents > [Your Agent]
  2. Click the Channels tab
  3. Select Web Widget
  4. Click Configure Widget to customize appearance
Widget Configuration

Step 2: Choose Your Style

Standard Button Options:

  • Style: Glass, White, or Black backgrounds
  • Chat Button Title: Welcome message (e.g., "Hi, let's chat!")
  • Button Avatar: Agent avatar or animated orb
  • Border: Simple or animated gradient borders

Floating Input Options:

  • Accent Color: Customize border, send button, and focus ring colors
  • Button Avatar: Agent avatar or animated orb

Orb Animations (Both Styles):

Choose from 5 animated orb styles: Glint, Orb, Command, Mana, or Halo. For Mana, Command, Glint, and Halo, you can select custom hex colors.

Step 3: Configure Domain Security

SECURITY REQUIRED: You must configure allowed domains before embedding your widget. This critical security measure prevents unauthorized use and protects your business and users' information from abuse.

Before embedding, add the domains where your widget will appear:

  1. In the Web Widget section, find Domain Security Settings
  2. Click Add Domain and enter your website domain (e.g., example.com)
  3. For subdomains, use wildcard notation: *.example.com
  4. Add multiple domains if embedding on multiple sites
  5. Click Save to apply changes

Why This Matters:

Without proper domain configuration, malicious actors could:

  • Copy your embed code and use it on unauthorized websites
  • Abuse your agent's usage limits and rack up costs
  • Access conversations and potentially sensitive business data
  • Damage your brand reputation by deploying your agent inappropriately

Domain Configuration Examples:

  • example.com - Only allows the exact domain
  • *.example.com - Allows all subdomains (e.g., app.example.com, blog.example.com, shop.example.com)
  • Add both example.com and www.example.com if you use both

Important: The widget will only load on whitelisted domains. Any unauthorized domain will be blocked, and the widget will not appear.

Testing Locally:

For local development, add localhost:3000 or 127.0.0.1:3000 to your allowed domains.

Step 4: Copy Embed Code

Note: The embed code will only be available after you've configured at least one allowed domain in Step 3.

Once you've configured at least one allowed domain:

  1. Choose your preferred embedding method (see below)
  2. Click Copy Code
  3. Paste the code into your website

Embedding Methods

The simplest way to embed your widget. 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.liquid before 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

For specific use cases where you need more control:

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-Specific Guides

WordPress

  1. Install a custom HTML plugin (e.g., "Insert Headers and Footers")
  2. Go to Settings > Insert Headers and Footers
  3. Paste the embed code in the Footer section
  4. Save changes

Alternative: Add to your theme's footer.php file before </body>

Shopify

  1. Go to Online Store > Themes
  2. Click Actions > Edit code
  3. Open theme.liquid
  4. Paste the embed code before the closing </body> tag
  5. Save changes

Wix

  1. Go to Settings > Custom Code
  2. Click + Add Custom Code
  3. Paste the embed code
  4. Set placement to Body - End
  5. Apply to all pages
  6. Save and publish

Squarespace

  1. Go to Settings > Advanced > Code Injection
  2. Paste the embed code in the Footer section
  3. Save changes

Webflow

  1. Go to Project Settings > Custom Code
  2. Paste the embed code in the Footer Code section
  3. Save and publish

Widget Features

Opened Chat Widget

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 Mode Active
  • 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

For advanced use cases, you can interact with the widget using 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:

  1. Verify your domain is added to the allowed domains list
  2. Ensure the domain matches exactly (including www if applicable)
  3. Check browser console for error messages

Check Embed Code:

  1. Verify the chatbotId is correct
  2. Ensure the script is placed before the closing </body> tag
  3. Check for JavaScript errors in the browser console

Clear Cache:

  1. Clear your browser cache
  2. Hard refresh the page (Ctrl+Shift+R or Cmd+Shift+R)
  3. Try in an incognito/private window

Domain Validation Error

If you see a "Domain validation failed" error, this means the domain security feature is working correctly by blocking unauthorized domains.

To Fix:

  1. Verify the domain is added to your allowed domains list in the dashboard
  2. Check the exact domain in your browser's address bar - it must match exactly
  3. If you're using www, add both example.com and www.example.com
  4. For subdomains, use wildcard notation: *.example.com
  5. Wait a few minutes after adding domains for changes to propagate
  6. Clear your browser cache and hard refresh (Ctrl+Shift+R or Cmd+Shift+R)

Common Mistakes:

  • Forgetting to include www when your site uses it
  • Using http:// instead of https:// 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

  1. Verify voice is enabled in your agent settings
  2. Check browser permissions for microphone access
  3. Ensure you're using HTTPS (voice requires secure context)
  4. Test in a supported browser (Chrome, Edge, Safari)

Next Steps


Need Help? Contact our support team at support@getlinkai.com or visit getlinkai.com

Follow us:
Knowledge Base