Widget Configuration
Hosting Mode
Basic Settings

Required for managed mode. Config is loaded from server. Also enables analytics and domain whitelisting.

SERVICES TO CONNECT TO

Click + to add a service to your widget.

+ n8n Click to switch
+ InfraNodus Click to switch
+ ElevenLabs
+ Telegram
+ Custom URL
Appearance

Display a text label next to the chat button

Messages
Behavior

Conversations will be sent to this email address.

Branding

Upgrade to a paid plan to remove the attribution notice.

Preview

Click "Preview Widget" to see your widget

Embed Code

Script Embed

Add this code to your website. Settings are loaded from our servers.

<!-- Save widget first to get embed code -->

iFrame Embed

Embed the widget in an iframe. Useful for sandboxed environments.

<!-- Save widget first to get embed code -->

Direct URL

Open the widget as a standalone page or link to it directly:

Save widget first to get URL
Open in New Tab

React Integration

For React applications, use this useEffect hook:

useEffect(() => { const script = document.createElement('script') script.src = 'https://n8n-chat-widget.com/widget.min.js' script.async = true script.onload = () => { if (typeof window.N8NWidget !== 'undefined') { new window.N8NWidget({ apiKey: 'YOUR_API_KEY' }) } } document.head.appendChild(script) return () => { if (document.head.contains(script)) { document.head.removeChild(script) } } }, [])
Danger Zone

Delete this widget

Once deleted, all widget data and message history will be permanently removed.

Quick Start

Get your AI chat widget up and running in 3 simple steps:

1. Create n8n Workflow

Build an AI chat workflow in n8n with a Webhook trigger, AI Agent with your knowledge base, and optionally connect an InfraNodus expert graph for enhanced responses.

2. Configure Widget

Use the Widget Builder tab to create your widget. Choose Self-Hosted for simple popup/inline embed, or Managed for URL/iFrame sharing and analytics.

3. Embed or Share

Copy the embed code into your website, or share the direct URL with your users. The widget connects to your n8n workflow automatically.

Embedding Methods

Script Embed (Self-Hosted Mode)

Add this code to your website with all settings inline:

<script src="__WIDGET_URL__"></script> <script> new N8NWidget({ webhookUrl: 'https://your-n8n.com/webhook/xxx', title: 'Chat with us', primaryColor: '#0084ff' }); </script>

Managed Mode (API Key)

Load configuration from server - update settings without changing embed code:

<script src="__WIDGET_URL__"></script> <script> new N8NWidget({ apiKey: 'your-api-key' }); </script>

Inline Embed

Embed the widget inside a specific container on your page:

<div id="n8n-chat-widget-container" style="height: 600px;"></div> <script> new N8NWidget({ mode: 'embed', targetElement: '#n8n-chat-widget-container', webhookUrl: 'https://your-n8n.com/webhook/xxx' }); </script>

iFrame Embed

Use an iframe for sandboxed environments or easy integration:

<iframe src="https://your-domain.com/widget-embed.html?id=YOUR_WIDGET_ID" style="width: 400px; height: 600px; border: none;"> </iframe>

React Integration

For React applications, use this useEffect hook to dynamically load and initialize the widget:

useEffect(() => { // Load N8N widget script dynamically const script = document.createElement('script') script.src = 'https://n8n-chat-widget.com/widget.min.js' script.async = true script.onload = () => { if (typeof window.N8NWidget !== 'undefined') { new window.N8NWidget({ // For self-hosted mode: webhookUrl: 'https://your-n8n.com/webhook/xxx', title: 'Chat with us', primaryColor: '#0084ff' // Or for managed mode: // apiKey: 'your-api-key', // widgetId: 'your-widget-id' }) } } document.head.appendChild(script) return () => { // Cleanup: remove script if component unmounts if (document.head.contains(script)) { document.head.removeChild(script) } } }, [])

Tip: You can also create a custom React component wrapper for reusability across your application.

Example Configurations

Support Chat

new N8NWidget({ webhookUrl: 'https://your-n8n.com/webhook/support', title: 'Support', subtitle: 'How can we help?', primaryColor: '#10b981' });

Sales Chat with Lead Capture

new N8NWidget({ webhookUrl: 'https://your-n8n.com/webhook/sales', title: 'Sales Team', subtitle: 'Get a free quote', primaryColor: '#8b5cf6', requireEmail: true, requireName: true, welcomeMessage: 'Hi! Looking for a quote? Let me help you.', autoOpen: true, openDelay: 5000 });

Webhook Integration

Request Payload

Your n8n webhook receives this data when a message is sent:

{ "message": "User's message text", "sessionId": "session-abc123", "timestamp": "2024-01-01T12:00:00.000Z", "url": "https://yoursite.com/page", "userName": "John Doe", "userEmail": "john@example.com" }

Response Format

Return a response in any of these formats:

// JSON response { "message": "Thanks for your message!" } // Alternative fields also work: { "output": "..." } { "response": "..." } { "text": "..." }

Programmatic Control

Control the widget from your JavaScript code:

const widget = new N8NWidget({ ... }); widget.open(); // Open the chat widget.close(); // Close the chat widget.toggle(); // Toggle open/close widget.destroy(); // Remove the widget

Configuration Parameters

Basic Settings

Parameter Type Default Description
webhookUrl string '' N8N webhook URL for message handling
mode string 'popup' Widget mode: 'popup', 'popup-multiple', or 'embed'
popupOptions array [] Popup options for multi-option mode.
multiOptionPrompt string 'How would you like to connect?' Header text for multi-option popup.
targetElement string null CSS selector for embed container

Appearance

Parameter Type Default Description
title string 'Chat with us' Widget header title
subtitle string 'We typically reply...' Widget header subtitle
primaryColor string '#0084ff' Primary theme color
textColor string '#ffffff' Header text color
backgroundColor string '#ffffff' Widget background color
width string '380px' Widget width
height string '600px' Widget height

Button Settings (Popup Mode)

Parameter Type Default Description
buttonPosition string 'bottom-right' Button position on screen
buttonSize number 60 Button size in pixels
buttonIcon string '💬' Button icon (emoji or text)
buttonText string '' Optional button text

Behavior

Parameter Type Default Description
autoOpen boolean false Auto-open widget on page load
openDelay number 0 Delay before auto-open (ms)
persistMessages boolean true Save messages in localStorage
showTimestamps boolean true Display message timestamps
requireEmail boolean false Require email before chat
requireName boolean false Require name before chat
hideAttribution boolean false Hide "Powered by Nodus Labs" notice (paid plans only)

Messages

Parameter Type Default Description
welcomeMessage string 'Hello! How can...' Initial bot message
placeholder string 'Type your message...' Input placeholder text
offlineMessage string 'We are currently...' Offline status message
errorMessage string 'Something went wrong...' Error message

Widget Analytics

Save your widget first to view analytics.

Analytics require a Managed widget

Analytics tracking is only available for widgets with an API key assigned.

To enable analytics, select Managed hosting mode and assign an API key to this widget.

Loading analytics...