infernus-widget
v0.4.2
Published
Embeddable customer chat widget for chat.infernus
Downloads
2,154
Maintainers
Readme
infernus-widget
Embeddable customer chat widget for chat.infernus. Simple, lightweight, and easy to integrate.
Quick Start
Option 1: Script Tag (Recommended)
<script
src="https://unpkg.com/infernus-widget"
data-workspace-id="your-workspace-id"
data-api-url="https://api.infernus.chat">
</script>That's it! A chat button appears in the bottom-right corner.
Option 2: npm Install
npm install infernus-widgetimport { boot } from 'infernus-widget';
boot({
workspaceId: 'your-workspace-id',
apiBaseUrl: 'https://api.infernus.chat',
theme: 'dark'
});Option 3: Self-hosted
Copy infernus-widget.js to your public/ folder:
<script
src="/infernus-widget.js"
data-workspace-id="your-workspace-id"
data-api-url="https://api.infernus.chat">
</script>Configuration
Script Tag Attributes
| Attribute | Required | Description |
|-----------|----------|-------------|
| data-workspace-id | Yes | Your system slug |
| data-api-url | Yes | API base URL |
| data-ws-url | No | WebSocket URL (defaults to {api-url}/ws/support) |
| data-theme | No | light or dark (default: light) |
| data-metadata | No | JSON string of custom metadata |
JavaScript API
import type { BootConfig } from 'infernus-widget';
const config: BootConfig = {
workspaceId: string; // Required
apiBaseUrl: string; // Required
wsBaseUrl?: string; // Optional
theme?: 'light' | 'dark'; // Optional (default: 'light')
metadata?: Record<string, unknown>; // Optional
};Methods
| Method | Description |
|--------|-------------|
| chatInfernus.boot(config) | Initialize and mount the widget |
| chatInfernus.init(config) | Alias for boot() |
| chatInfernus.setMetadata(workspaceId, data) | Update metadata after init |
Features
- Zero config — works with just a script tag
- Real-time — SignalR-powered live messaging
- Threaded Slack — conversations sync to Slack threads
- Typing indicators — real-time typing status
- Read receipts — delivered/read checkmarks
- Emoji reactions — react to agent messages
- Custom metadata — attach context to messages
- TypeScript — full type declarations included
License
MIT
