@david_emissary/sdk
v0.1.7
Published
Emissary SDK for chat widgets and utilities
Downloads
47
Readme
Emissary SDK
A React SDK for building chat-based appliance troubleshooting interfaces.
Installation
npm install @david_emissary/sdkUsage
import { ChatWidget } from '@david_emissary/sdk';
function App() {
return (
<ChatWidget
applianceType="refrigerator"
brand="Samsung"
model="RF28R7551SR"
onMessage={(message) => {
console.log('New message:', message);
}}
onClose={() => {
console.log('Chat closed');
}}
onStatusChange={(status) => {
console.log('Chat status:', status);
}}
onStepChange={(step) => {
console.log('Current step:', step);
}}
theme={{
primary: '#4F46E5',
secondary: '#E0E7FF',
background: 'white',
text: 'gray-900'
}}
/>
);
}Props
ChatWidget
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| applianceType | string | '' | Type of appliance (e.g., 'refrigerator', 'washer', etc.) |
| brand | string | '' | Brand of the appliance |
| model | string | '' | Model number of the appliance |
| onMessage | (message: string) => void | undefined | Callback when a message is sent |
| onClose | () => void | undefined | Callback when the chat is closed |
| onStatusChange | (status: 'open' | 'closed') => void | undefined | Callback when chat status changes |
| onStepChange | (step: string) => void | undefined | Callback when the current step changes |
| theme | Theme | {} | Custom theme configuration |
Theme
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| primary | string | '#4F46E5' | Primary color for buttons and accents |
| secondary | string | '#E0E7FF' | Secondary color for backgrounds |
| background | string | 'white' | Background color |
| text | string | 'gray-900' | Text color |
Development
# Install dependencies
npm install
# Build the SDK
npm run build
# Run type checking
npm run type-check
# Run linting
npm run lintLicense
MIT
