
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@chrisabdo/rag-chatbot-widget
Advanced tools
A simple, customizable React component for adding a Retrieval-Augmented Generation (RAG) chatbot widget to your web application.
npm install rag-chatbot-widget
# or
yarn add rag-chatbot-widget
# or
pnpm add rag-chatbot-widget
import { ChatbotWidget } from 'rag-chatbot-widget';
import 'rag-chatbot-widget/styles.css'; // Import the styles
function App() {
return (
<div className="app">
<h1>My Application</h1>
{/* Add the chatbot widget */}
<ChatbotWidget
apiUrl="/api/chat"
title="Knowledge Assistant"
/>
</div>
);
}
The ChatbotWidget
component accepts the following props:
Prop | Type | Default | Description |
---|---|---|---|
title | string | 'RAG Chatbot' | Title for the chatbot modal |
buttonIcon | ReactNode | '💬' | Button icon content (emoji, text, or SVG) |
buttonAriaLabel | string | 'Open chatbot' | Button aria-label for accessibility |
zIndex | number | 9999 | CSS z-index for the widget |
buttonPosition | string | 'bottom-right' | Button position ('bottom-right' , 'bottom-left' , 'top-right' , 'top-left' ) |
buttonClassName | string | '' | Custom class for the button |
theme | string | 'auto' | Widget theme ('light' , 'dark' , 'auto' ) |
Prop | Type | Default | Description |
---|---|---|---|
apiUrl | string | '/api/chat' | API endpoint for the chatbot |
apiHeaders | object | { 'Content-Type': 'application/json' } | Headers for API requests |
placeholder | string | 'Ask a question...' | Placeholder text for the input field |
initialMessages | array | [] | Initial messages to display |
className | string | '' | Custom class for the chat component |
Your backend API should accept POST requests with the following structure:
{
"query": "User's question here"
}
And it should respond with:
{
"response": "Assistant's response here"
}
If you want to use the chat interface without the floating button and modal, you can use the Chat
component directly:
import { Chat } from 'rag-chatbot-widget';
import 'rag-chatbot-widget/styles.css';
function MyCustomChatInterface() {
return (
<div className="chat-container" style={{ height: '500px' }}>
<Chat
apiUrl="/api/chat"
placeholder="Ask me anything..."
/>
</div>
);
}
MIT
FAQs
A simple RAG chatbot widget for web applications
The npm package @chrisabdo/rag-chatbot-widget receives a total of 1 weekly downloads. As such, @chrisabdo/rag-chatbot-widget popularity was classified as not popular.
We found that @chrisabdo/rag-chatbot-widget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.