window.LuaPop.init(config)
Initialize the LuaPop widget with the provided configuration.destroy() method
Required Configuration
Required. The ID of the AI agent to use for conversations.Get this from your Lua AI dashboard.
Basic Configuration
Widget position on the page.Options:
"bottom-right", "bottom-left", "top-right", "top-left"Text displayed on the chat button.
API environment to use.Options:
"staging", "production", "custom"Authentication & Session
Unique session identifier for the user.If not provided, auto-generated. Use for persistent conversations across page loads.
Optional authentication token for authenticated users.
Custom API base URL (only when
environment is "custom").Display Configuration
How the widget is displayed.Options:
"floating", "embedded"Configuration for embedded mode.Example:
Height of the chat window.
Width of the chat window.
Visual Customization
Background color of the chat button.
Icon or emoji displayed on the button.
Title displayed in the chat header.
Placeholder text for the input field.
Welcome message displayed when the chat is first opened and no conversation history exists.This message appears as the first assistant message, helping to greet users and set the tone for the conversation.
Advanced Styling
Custom CSS styles for the chat button.
Custom CSS styles for button positioning.
Custom CSS styles for the chat header.
Branding
Subtitle configuration for branding.Example:
Advanced Features
Enable voice chat functionality.
Disable automatic link previews.
Additional context passed to the AI agent.Useful for providing page context, user roles, etc.
Event Handlers
Handler for navigation events from the chat.Example:
Complete Example
Configuration Tips
Use Staging for Testing
Use Staging for Testing
Always test new configurations with staging first:
Generate Unique Session IDs
Generate Unique Session IDs
Create unique sessions for better tracking:
Use Runtime Context
Use Runtime Context
Pass page context to help the AI provide better responses:
Responsive Configuration
Responsive Configuration
Adjust for different screen sizes:

