1.0.5 • Published 12 months ago
@emobot/emobot-embed v1.0.5
Emobot Widget
An embeddable emoji bot widget for React applications.
Installation
# Using yarn
yarn add @emobot/emobot-embed
# Using npm
npm install @emobot/emobot-embed
Usage
import { Emobot } from '@emobot/emobot-embed';
function App() {
return (
<Emobot
customerId="your-customer-id"
onBotLoad={(bot) => console.log('Bot loaded:', bot)}
/>
);
}
Props
Prop | Type | Required | Description |
---|---|---|---|
customerId | string | Yes | Your unique customer identifier |
apiUrl | string | No | Custom API URL (defaults to https://api.emobot.com) |
className | string | No | Additional CSS classes |
onBotLoad | (bot: BotData) => void | No | Callback when bot data is loaded |
onError | (error: Error) => void | No | Callback when an error occurs |
Types
interface BotData {
id: string;
name: string;
emotion: 'happy' | 'sad' | 'angry' | 'neutral' | 'excited' | 'thoughtful' | 'loving';
message: string;
suggestions?: Array<string>;
}
Development
# Install dependencies
yarn install
# Run development build
yarn dev
# Build for production
yarn build
# Run type checking
yarn typecheck
License
MIT © Zimi Engineering