Skip to main content

Event System

LuaPop communicates with your website through the browser’s postMessage API. Listen for events to track interactions, trigger actions, or integrate with analytics.

Widget Events

Listening to Events

Available Events

event
Fired when the chat widget is opened by the user.Data: {}
event
Fired when the chat widget is closed.Data: {}
event
Fired when the user sends a message.Data: { content: string, timestamp: string }
event
Fired when the AI sends a response.Data: { content: string, timestamp: string }

Resize Events

For embedded mode, listen to resize events:
Handle navigation events from the chat:

Complete Event Handler

Use Cases

Track Chat Engagement

Show Help Hints

Auto-Open for New Users

Next Steps

Analytics

Track chat interactions

Examples

See event handling examples
EOFSTYLE