syncassistant-sdk
v0.1.47
Published
Sync AI Assistant embeddable chat widget
Readme
Sync AI Assistant SDK
Embeddable JavaScript SDK for the Sync AI chat widget.
Installation
npm install syncassistant-sdkUsage
import { init, destroy, toggle } from 'syncassistant-sdk';
// Minimal setup - mode is fetched automatically
init({
apiKey: 'your-api-key',
apiUrl: 'https://sync-assistant-backend-production.up.railway.app/api/chat',
});
// Or customize theme/position if needed
init({
apiKey: 'your-api-key',
apiUrl: 'https://sync-assistant-backend-production.up.railway.app/api/chat',
theme: 'dark', // Optional
position: 'bottom-right', // Optional
});
// Toggle chat window (optional)
// toggle();
// Remove widget (optional)
// destroy();Configuration
| Option | Type | Default | Description |
|-------------------|---------------------|-----------------------------|-------------|
| apiKey | string | required | API key from the Sync AI dashboard |
| apiUrl | string | https://sync-assistant-backend-production.up.railway.app/api/chat | Chat endpoint to forward messages |
| theme | 'light' \| 'dark' | 'light' | Base theme for widget UI |
| position | SyncAIPosition | 'bottom-right' | Widget anchor position |
| primaryColor | string | '#000000' | Accent color for buttons and header |
| textColor | string | '#000000' | Text color for assistant replies |
| backgroundColor | string | '#ffffff' | Chat window background |
API
init(config)– creates the widget and mounts it to the page.destroy()– removes the widget instance and cleans up DOM nodes.toggle()– toggles the chat window open/closed if initialized.
