A customizable plug-and-play chatbot component for React applications, designed to work seamlessly with the Modelosaurus API. Easily integrate a powerful AI chatbot into your application with minimal configuration.
- ✨ Plug-and-Play: Minimal setup required
- 🎨 Customizable UI: Colors, sizing, fonts, and more
- 🤖 AI-Powered: Leverages Modelosaurus LLMs like Llama 3.1
- 📚 RAG Support: Connect to your knowledge base with vector search
- ⚡ Streaming Responses: Real-time streaming for a better user experience
- 📱 Responsive Design: Works on all device sizes
- 🔍 TypeScript Support: Fully typed for better developer experience
Using npm:
npm install modelosaurus-chatbot
Using yarn:
yarn add modelosaurus-chatbot
Before integration, visit modelosaurus.com to:
- Create an account and get your API key
- Create a custom chatbot
- Upload documents for RAG (optional)
- Configure appearance and behavior
- Get your chatbot ID
Basic integration in a React application:
import React from 'react';
import ModelosaurusChatbot from 'modelosaurus-chatbot';
function App() {
return (
<ModelosaurusChatbot
modelosaurusKey={process.env.REACT_APP_MODELOSAURUS_API_KEY}
chatbotId="your-chatbot-id"
/>
);
}
export default App;
Prop | Type | Required | Default | Description |
---|---|---|---|---|
modelosaurusKey |
string | Yes | - | Your Modelosaurus API key |
chatbotId |
string | Yes | - | Your chatbot ID from Modelosaurus |
Note: Additional customization options (colors, fonts, etc.) are configured through the Modelosaurus dashboard and automatically applied to your component.
Customize your chatbot's appearance and behavior using the Modelosaurus dashboard.
IMPORTANT: Never hardcode your API key directly in your frontend code in production. IMPORTANT: Never push your .env file containing sensitive information to any source control software.
Recommended approach: (example)
# Use environment variables
REACT_APP_MODELOSAURUS_API_KEY=your_secret_key
Import types for enhanced type checking:
import {
ChatbotData,
ChatMessage,
ModelosaurusChatbotProps
} from 'modelosaurus-chatbot';
Available types:
ModelosaurusChatbotProps
: Props for the main componentChatbotData
: Configuration options for the chatbotChatMessage
: Individual message structure
To explore the component:
# Clone the repository
git clone https://github.com/haadiyeah/modelosaurus-chatbot.git
# Install dependencies
npm install
# Run Storybook
npm run storybook
Storybook will launch at http://localhost:6006
# Install dependencies
npm install
# Start development build
npm run dev
# Build for production
npm run build
- Configure your chatbot on modelosaurus.com
- The component fetches your configuration settings using your
chatbotId
- Messages are sent to the Modelosaurus API for processing
- Responses are streamed back to the component in real-time
- If RAG is enabled, responses are enhanced with information from your documents
This project is licensed under the MIT License. See the LICENSE file for details.