1.0.5 • Published 12 months ago

@emobot/emobot-embed v1.0.5

Weekly downloads
-
License
-
Repository
-
Last release
12 months ago

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

PropTypeRequiredDescription
customerIdstringYesYour unique customer identifier
apiUrlstringNoCustom API URL (defaults to https://api.emobot.com)
classNamestringNoAdditional CSS classes
onBotLoad(bot: BotData) => voidNoCallback when bot data is loaded
onError(error: Error) => voidNoCallback 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