Lemah Logo
LEMAH
Start Free
Integration Documentation

Connect Lemah to Any Website

Deploy your autonomous AI assistant in under 3 minutes. Choose between our official WordPress plugin or universal 1-click script tag for custom web stacks.

Section 1

Architecture & Core Capabilities

The Lemah Chat Widget is an ultra-lightweight, standalone conversational bubble that plugs into any existing website. It connects directly with your Lemah multi-tier intelligence engine (retrieving data from your uploaded PDFs, FAQs, product catalogs, and website URLs) to resolve customer inquiries 24/7.

< 15 KB

Zero Overhead

Pure vanilla JavaScript. Zero external libraries. 100% immune to CSS bleeding or theme conflicts.

Non-Blocking

Async Execution

Loads with the async attribute to guarantee zero penalty on Google Core Web Vitals or LCP.

Instant Sync

Cloud Updates

Change colors, greetings, or knowledge base in your Lemah dashboard; changes reflect instantly on your site.

Section 2

Official WordPress Plugin

Recommended for WordPress, WooCommerce, Elementor, and Divi sites.

Download .zip
1

Install the Plugin ZIP

In your WordPress Admin, go to Plugins > Add New > Upload Plugin. Choose the downloaded lemah-ai.zip file, click Install Now, and then click Activate Plugin.

2

Retrieve Your Bot Key

Log into your Lemah Dashboard, go to Integrations > Website & WordPress Widget, and copy your unique Bot Key (e.g., bot_7f9b8c3a).

3

Paste Key & Save

In WordPress, navigate to Settings > Lemah AI. Paste your Bot Key into the field, choose your launcher position (Bottom Right or Bottom Left), and click Save Changes.

Administrator Preview: The WordPress plugin includes an option to "Hide for Logged-In Administrators" so you can browse your admin dashboard cleanly without the floating chat icon.

Section 3

1-Click Universal HTML Snippet

If you are not using WordPress, paste this single script snippet into your site’s HTML, right before the closing </body> tag:

<script 
  src="https://app.lemah.ai/widget.js" 
  data-bot-key="YOUR_WORKSPACE_BOT_KEY" 
  async>
</script>

Note on the Bot Key:

Replace YOUR_WORKSPACE_BOT_KEY with the unique key found in your Lemah Dashboard under Integrations > Website Widget.
Section 4

Platform-by-Platform Instructions

Select your website builder or e-commerce engine below for exact click-by-click instructions:

Section 5

Modern Web Frameworks (Next.js & React)

For modern single-page applications or server-rendered frameworks, you can load the widget non-intrusively:

Next.js App Router (layout.tsx)
import Script from 'next/script';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script 
          src="https://app.lemah.ai/widget.js" 
          data-bot-key="YOUR_WORKSPACE_BOT_KEY" 
          strategy="lazyOnload" 
        />
      </body>
    </html>
  );
}
React Single Page App (Vite / CRA)
import { useEffect } from 'react';

export function LemahChatWidget({ botKey }: { botKey: string }) {
  useEffect(() => {
    const script = document.createElement('script');
    script.src = 'https://app.lemah.ai/widget.js';
    script.setAttribute('data-bot-key', botKey);
    script.async = true;
    document.body.appendChild(script);

    return () => {
      // Optional cleanup if unmounting
      const existing = document.querySelector('script[src*="widget.js"]');
      if (existing) existing.remove();
      const widgetDrawer = document.getElementById('lemah-widget-container');
      if (widgetDrawer) widgetDrawer.remove();
    };
  }, [botKey]);

  return null;
}
Section 6

Styling, Colors & White-Labeling

You can customize the appearance of the chat widget directly from your Lemah Dashboard under Integrations > Widget Styling:

SettingOptionsDescription
Brand ColorHex Code (e.g. #2563EB)Colors the floating button, send button, header bar, and quick chips.
Assistant Namee.g. "Sophia - Support"Displayed at the top of the chat drawer alongside the online status indicator.
Initial GreetingCustom welcome textThe first proactive message the visitor sees when opening the drawer.
Widget Positionbottom-right | bottom-leftChoose which corner of the screen the floating button anchors to.
Remove BrandingPro & Enterprise PlanHides the "Powered by Lemah" footer badge completely for full white-labeling.
Section 7

Security, Domains & Quota Guards

Lemah protects your business and brand reputation with enterprise-grade guardrails:

Domain Allowlisting

Prevent unauthorized websites from embedding your bot. You can specify a comma-separated list of allowed domains in your Workspace Settings (e.g. mycompany.com, shop.mycompany.com).

Predictable Quota Protection

If your workspace reaches its monthly message quota, your site visitors are politely informed without errors, and an immediate notification email is sent to your account owner to upgrade with zero downtime.

Section 8

Frequently Asked Questions & Troubleshooting

Q:The chat widget is not showing up on my site. What should I check?

1. Confirm that your Bot Key in data-bot-key exactly matches the key in your Lemah dashboard. 2. Verify that the script tag is placed before </body>. 3. Check your browser's Developer Console (F12) for any Content Security Policy (CSP) blocks.

Q:Can my human support agents take over a live conversation?

Yes! When visitors chat through the website widget, the conversation streams in real time to your Lemah Live Arena dashboard. An agent can click 'Takeover' to pause the AI and chat directly with the visitor.

Q:How does the AI know about our products and refund policies?

Go to your Lemah Dashboard > Knowledge Lab. Upload your PDF documents, website URLs, or FAQ spreadsheets. Lemah's RAG engine automatically vectors your files and equips the bot with precise knowledge.

Q:Does the widget remember conversations when a user clicks to another page?

Yes. The session is seamlessly preserved in browser localStorage for the duration of the visit, so users can navigate across your site without losing their chat context.

Q:Can I remove the 'Powered by Lemah' badge?

Yes! Workspaces on the Pro or Enterprise plan can toggle 'Remove Lemah Branding' under Integrations > Widget Styling.