A modern, WhatsApp-like chat widget with full media support and n8n integration
Configure your widget settings below and click "Initialize Widget" to see it in action!
Send and receive text messages with emoji support and URL previews
Share images with automatic compression and thumbnail generation
Send and play videos directly in the chat interface
Record and send voice messages with waveform visualization
Share PDFs, Word docs, Excel sheets, and more
Automatic link previews with title, description, and image
<script>
// Force cache refresh - load from CDN with timestamp
(function() {
const script = document.createElement('script');
script.src = 'https://widget.connectgain.cloud/connectgain-widget.min.js?v=' + Date.now();
script.async = true;
document.head.appendChild(script);
})();
</script>
Why cache busting? Ensures you always get the latest widget version with all bug fixes and features.
<script>
ConnectGainWidget.init({
apiKey: 'your-appgain-api-key',
suitId: 'your-unique-suit-id',
webhooks: {
incoming: 'https://n8n.instabackend.io/webhook/bot'
},
theme: {
primaryColor: '#7C3AED',
headerText: 'Support Chat'
}
});
</script>
n8n can send messages directly to the widget using JavaScript:
// In your n8n workflow, use Execute JavaScript node:
ConnectGainWidget.sendMessage({
type: 'text',
text: 'Hello from n8n!',
sender: 'agent'
});
// Or send media messages:
ConnectGainWidget.sendMessage({
type: 'image',
fileUrl: 'https://example.com/image.jpg',
thumbnailUrl: 'https://example.com/thumb.jpg',
caption: 'Here is the image you requested',
sender: 'agent'
});
Your n8n workflow should:
ConnectGainWidget.sendMessage()The widget supports all common WhatsApp message types:
After initializing the widget, try these test scenarios:
You can also push messages directly to the widget: