Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.heylua.ai/llms.txt

Use this file to discover all available pages before exploring further.

Before You Start: Whitelist Your Website

You must whitelist your domain before the widget will load. In the Lua AI admin dashboard, go to Chat WidgetCustomization and add your website URL to the allowed sites list. The widget silently refuses to initialise on any domain not listed here.
Testing on localhost? localhost cannot be whitelisted — the dashboard approach will not work. You must pass your configuration inline and set environment: "production" explicitly:
<script src="https://lua-ai-global.github.io/lua-pop/lua-pop.umd.js"></script>
<script>
  window.LuaPop.init({
    agentId: "your-agent-id",
    environment: "production"
  });
</script>
This bypasses the domain whitelist check so you can develop and test locally against your real agent.

Setup Options

There are two ways to get the widget running. The dashboard approach is recommended — it requires no code changes when you update settings.

Common Setups

Customer Support

<script src="https://lua-ai-global.github.io/lua-pop/lua-pop.umd.js"></script>
<script>
  window.LuaPop.init({
    agentId: "support-agent-id",
    chatTitle: "Customer Support",
    buttonText: "💬 Need Help?",
    position: "bottom-right",
    welcomeMessage: "Hi there! 👋 How can we help you today?",
    chatInputPlaceholder: "Describe your issue..."
  });
</script>

Sales Assistant

<script src="https://lua-ai-global.github.io/lua-pop/lua-pop.umd.js"></script>
<script>
  window.LuaPop.init({
    agentId: "sales-agent-id",
    chatTitle: "Sales Assistant",
    buttonText: "💰 Get Quote",
    buttonColor: "#28a745",
    position: "bottom-right"
  });
</script>

Embedded Chat (No Floating Button)

<!-- Create a container -->
<div id="chat-container" style="width: 400px; height: 600px;"></div>

<!-- Initialize embedded mode -->
<script src="https://lua-ai-global.github.io/lua-pop/lua-pop.umd.js"></script>
<script>
  window.LuaPop.init({
    agentId: "your-agent-id",
    displayMode: "embedded",
    embeddedDisplayConfig: {
      targetContainerId: "chat-container"
    }
  });
</script>

Quick Customizations

Change Position

position: "bottom-right"

Custom Colors & Button

window.LuaPop.init({
  agentId: "your-agent-id",
  buttonColor: "#ff6b6b",      // Custom button color
  buttonText: "💬 Chat Now",   // Custom text
  buttonIcon: "🤖",            // Custom icon/emoji
  chatTitle: "AI Assistant"    // Custom title
});

Testing Environments

Staging (For Testing)

window.LuaPop.init({
  agentId: "your-agent-id",
  environment: "staging", // Uses api.lua.dev
  position: "bottom-right"
});

Production (Live)

window.LuaPop.init({
  agentId: "your-agent-id",
  environment: "production", // Uses api.heylua.ai
  position: "bottom-right"
});
Always test with environment: "staging" before switching to production!

Framework Integration Quick Start

React

import { useEffect } from 'react';

export default function ChatWidget() {
  useEffect(() => {
    const script = document.createElement('script');
    script.src = 'https://lua-ai-global.github.io/lua-pop/lua-pop.umd.js';
    script.onload = () => {
      window.LuaPop?.init({
        agentId: "your-agent-id",
        position: "bottom-right"
      });
    };
    document.body.appendChild(script);
  }, []);

  return null;
}

Vue

<script>
export default {
  mounted() {
    const script = document.createElement('script');
    script.src = 'https://lua-ai-global.github.io/lua-pop/lua-pop.umd.js';
    script.onload = () => {
      window.LuaPop?.init({
        agentId: "your-agent-id",
        position: "bottom-right"
      });
    };
    document.body.appendChild(script);
  }
};
</script>

More Framework Examples

See integration guides for Angular, Next.js, and more

Troubleshooting

Check these:
  1. Open browser console for JavaScript errors
  2. Verify your agent ID is correct
  3. Ensure script is loaded after DOM is ready
  4. Check if another chat widget is conflicting
Solutions:
  1. Check your internet connection
  2. Verify agent ID exists in Lua AI dashboard
  3. Try environment: "staging" for testing
  4. Check browser console for API errors
Solutions:
  1. Check for CSS conflicts using browser dev tools
  2. Try a different position
  3. Add higher z-index:
    popupButtonStyles: {
      zIndex: "9999"
    }
    

Next Steps

Full Configuration

Explore all configuration options

Custom Styling

Match your brand perfectly

Real Examples

See production implementations

Track Events

Monitor chat interactions