A sleek, responsive floating chat widget designed for seamless integration across multiple websites. The widget is hosted centrally and embedded into client sites via iframe, requiring no complex setup.
- Real-time Messaging: Instant communication with streaming responses
- Customizable Branding: Colors, logo, welcome message, and positioning
- Smart Behavior: Auto-triggers on scroll, inactivity detection
- Responsive Design: Works perfectly on desktop, tablet, and mobile
- Easy Integration: Simple iframe or script tag embedding
- Cross-platform: Compatible with any website or platform
Copy the example environment file and configure your API settings:
cp .env.example .env.localAdd your NEBUL API credentials to .env.local:
NEBUL_API_URL=https://api.nebul.ai/v1/chat/completions
NEBUL_API_KEY=your_nebul_api_key_here
NEBUL_MODEL=your_model_name_herenpm installnpm run devVisit http://localhost:3000 to see the widget demo.
Add this to your website's HTML:
<script>
window.ChatWidgetConfig = {
baseUrl: "https://your-widget-domain.com",
brandColor: "#3B82F6",
welcomeMessage: "Hi! How can I help you today?",
};
</script>
<script src="https://your-widget-domain.com/embed.js"></script>Embed the widget directly:
<iframe
src="https://your-widget-domain.com/widget?brandColor=%233B82F6"
style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; border: none; z-index: 9999; pointer-events: none; background: transparent;"
></iframe>| Parameter | Type | Default | Description |
|---|---|---|---|
brandColor |
string | #3B82F6 |
Widget theme color (hex code) |
logo |
string | undefined |
URL to your company logo |
welcomeMessage |
string | Hi! How can I help you today? |
Initial message from assistant |
position |
string | bottom-right |
Widget position (bottom-right or bottom-left) |
showOnScroll |
boolean | true |
Pulse widget when user scrolls |
showOnInactivity |
boolean | true |
Pulse widget after inactivity |
inactivityDelay |
number | 30000 |
Inactivity delay in milliseconds |
E-commerce Store:
window.ChatWidgetConfig = {
baseUrl: "https://your-widget-domain.com",
brandColor: "#FF6B6B",
logo: "https://your-store.com/logo.png",
welcomeMessage: "Welcome to our store! Need help finding something?",
showOnScroll: true,
inactivityDelay: 20000,
};SaaS Platform:
window.ChatWidgetConfig = {
baseUrl: "https://your-widget-domain.com",
brandColor: "#10B981",
welcomeMessage: "Hi! Need help with our platform?",
position: "bottom-left",
showOnInactivity: true,
inactivityDelay: 45000,
};Handles chat message processing with streaming support.
Request:
{
"messages": [
{
"role": "user",
"content": "Hello, how can you help me?"
}
]
}Response: Streaming Server-Sent Events with content chunks.
├── app/
│ ├── api/chat/route.ts # Chat API endpoint
│ ├── components/ChatWidget.tsx # Main widget component
│ ├── widget/ # Widget iframe page
│ │ ├── page.tsx
│ │ └── layout.tsx
│ ├── page.tsx # Demo/documentation page
│ └── layout.tsx
├── public/
│ ├── embed.js # Client-side embed script
│ └── demo.html # Standalone demo
└── .env.example # Environment template
- Scroll Detection: Widget pulses when user scrolls past 100px
- Inactivity Detection: Widget pulses after specified delay without user interaction
- Responsive Design: Adapts to different screen sizes
- Cross-browser: Compatible with modern browsers
- Closed: Floating button in corner
- Open: Full chat interface
- Minimized: Small icon when minimized by user
- Pulsing: Attention-grabbing animation
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]Ensure these are set in your production environment:
NEBUL_API_URLNEBUL_API_KEYNEBUL_MODEL
Test the widget on different sites:
- Visit
/demo.htmlfor a standalone demo - Use browser dev tools to test responsive behavior
- Test iframe integration on external sites
- Chrome/Chromium (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- API keys are server-side only
- CORS configured for iframe embedding
- Content Security Policy friendly
- No client-side API key exposure
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details.
For technical support or questions:
- Open an issue on GitHub
- Check the documentation
- Review the demo examples