window.PSquaredChat object.
Developer guide
Widget control
Control the InboxMate widget programmatically with JavaScript.
After the widget script loads, you can control it programmatically through the
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Control the InboxMate widget programmatically with JavaScript.
window.PSquaredChat object.
window.PSquaredChat.init({
agentId: 'your-agent-id',
theme: 'auto', // 'light', 'dark', or 'auto'
primaryColor: '#10b981',
position: 'bottom-right', // 'bottom-left' or 'bottom-right'
uiLang: 'multi', // 'en', 'de', or 'multi'
buttonIcon: 'messageCircle', // 'messageCircle', 'chat', 'help', 'support', 'bubble', or 'custom'
buttonAnimation: 'default' // 'default', 'bounce', 'slide', 'fade', or 'none'
});
const widget = window.PSquaredChat.widget;
window.PSquaredChat.destroy();
| Option | Type | Description |
|---|---|---|
agentId | string | Your agent’s unique identifier |
theme | string | light, dark, or auto (follows system preference) |
primaryColor | string | Hex color for the widget theme |
position | string | bottom-left or bottom-right |
uiLang | string | en, de, or multi (auto-detect) |
buttonIcon | string | Preset icon or custom with buttonIconUrl |
buttonIconUrl | string | URL for a custom button icon |
buttonAnimation | string | Trigger button animation style |
showOnPages | string[] | URL patterns where the widget should appear |
hideOnPages | string[] | URL patterns where the widget should be hidden |
window.PSquaredChat.init({
agentId: 'your-agent-id',
emailCollection: {
enabled: true,
requestAfterMessage: 3, // Ask for email after 3 messages
collectName: true
}
});
window.PSquaredChat.init({
agentId: 'your-agent-id',
humanSupport: {
enabled: true,
// Customize handover messages per language
}
});
window.PSquaredChat.init({
agentId: 'your-agent-id',
delayedMessages: [
{
delay: 5000, // 5 seconds
message: {
en: 'Need help? Ask me anything!',
de: 'Brauchen Sie Hilfe? Fragen Sie mich!'
}
}
]
});