{"_id":"@benbassatido/ai-chatbot","_rev":"5-5e0305b275b54b6811aa8b084cfa8fa5","name":"@benbassatido/ai-chatbot","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@benbassatido/ai-chatbot","version":"0.1.0","license":"MIT","_id":"@benbassatido/ai-chatbot@0.1.0","maintainers":[{"name":"benbassatido","email":"benbassatido@gmail.com"}],"dist":{"shasum":"21c5f4f819e9dc3365a4b4f30cd0cfc2a01d42d1","tarball":"https://registry.npmjs.org/@benbassatido/ai-chatbot/-/ai-chatbot-0.1.0.tgz","fileCount":5,"integrity":"sha512-pdu9nWdGDrxDXGxbgMVv+Z0UbNNqEn2TDuYTMt4UoucySZ/YFSBFiUa6sgpj2oMJVg4LfqB6FgI3Tz0RNtcduw==","signatures":[{"sig":"MEYCIQDD8ecQ/6OJCRtWYfPERbOR6DZ8QvDe+cEWn0twvtlXlgIhAKLqukpVi0tCkJjlz4KwWi5bIWMGBpD+hDLIP0yYKYQx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20164},"main":"./dist/my-ai-chatbot.js","type":"module","module":"./dist/my-ai-chatbot.js","exports":{".":{"import":"./dist/my-ai-chatbot.js"},"./style.css":"./dist/my-ai-chatbot.css"},"gitHead":"84f121a006022dce2307d831c4406fe1573c4393","scripts":{"dev":"vite","lint":"eslint .","build":"vite build","preview":"vite preview","build:lib":"vite build --config vite.lib.config.js","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"benbassatido","email":"benbassatido@gmail.com"},"_npmVersion":"11.11.0","description":"A React chat widget powered by OpenRouter AI with markdown support, RTL/LTR, localStorage persistence, and smooth animations.","directories":{},"sideEffects":["**/*.css"],"_nodeVersion":"22.15.1","dependencies":{"axios":"^1.13.6","framer-motion":"^12.38.0","react-markdown":"^10.1.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.1","react":"^19.2.4","eslint":"^9.39.4","globals":"^17.4.0","react-dom":"^19.2.4","@eslint/js":"^9.39.4","@types/react":"^19.2.14","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.5.2"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-chatbot_0.1.0_1774097593949_0.4300329952903601","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@benbassatido/ai-chatbot","version":"0.1.1","license":"MIT","_id":"@benbassatido/ai-chatbot@0.1.1","maintainers":[{"name":"benbassatido","email":"benbassatido@gmail.com"}],"dist":{"shasum":"e957171ac53fe11c7061b2f111a5b8a58482c14b","tarball":"https://registry.npmjs.org/@benbassatido/ai-chatbot/-/ai-chatbot-0.1.1.tgz","fileCount":5,"integrity":"sha512-fa3ToKLxtnT8OR/vWy0p2Psa+vzFg0pQFNgLBlOQa6teh7eu/qROdQBF2CGE+1QldxNoDXWeS17oUMFJnkiVaw==","signatures":[{"sig":"MEQCIGK1oRJMIswjkXg/QMD5QIV9IP5a06fWz8jcqldJmJBOAiAMvxRcqBDtvja5SMhVq+SjSN5vohWWKnZiNUnOzS64Rw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18744},"main":"./dist/my-ai-chatbot.js","type":"module","module":"./dist/my-ai-chatbot.js","exports":{".":{"import":"./dist/my-ai-chatbot.js"},"./style.css":"./dist/my-ai-chatbot.css"},"gitHead":"984157c66af4c084ea069de14d2c978f3f2b09d5","scripts":{"dev":"vite","lint":"eslint .","build":"vite build","preview":"vite preview","build:lib":"vite build --config vite.lib.config.js","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"benbassatido","email":"benbassatido@gmail.com"},"_npmVersion":"11.11.0","description":"A React chat widget powered by OpenRouter AI with markdown support, RTL/LTR, localStorage persistence, and smooth animations.","directories":{},"sideEffects":["**/*.css"],"_nodeVersion":"22.15.1","dependencies":{"axios":"^1.13.6","framer-motion":"^12.38.0","react-markdown":"^10.1.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.1","react":"^19.2.4","eslint":"^9.39.4","globals":"^17.4.0","react-dom":"^19.2.4","@eslint/js":"^9.39.4","@types/react":"^19.2.14","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.5.2"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-chatbot_0.1.1_1774100020675_0.46002329043450185","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@benbassatido/ai-chatbot","version":"0.1.2","license":"MIT","_id":"@benbassatido/ai-chatbot@0.1.2","maintainers":[{"name":"benbassatido","email":"benbassatido@gmail.com"}],"homepage":"https://github.com/benbassatido/ai-chatbot","bugs":{"url":"https://github.com/benbassatido/ai-chatbot/issues"},"dist":{"shasum":"60a668c6757d665716aa5ab8a848251809429df3","tarball":"https://registry.npmjs.org/@benbassatido/ai-chatbot/-/ai-chatbot-0.1.2.tgz","fileCount":5,"integrity":"sha512-da/dhdxCPk0BR7eziXHIIavd52LKJhIF5wvjC3IKBUh7+MyKmryeOL1yTbIeJV5yyaK9AO4TJey49WdfPTJ20A==","signatures":[{"sig":"MEUCIQDUFfANb3priEl8hUWovpvzUmg9cXNkhW33lVbqbyRkdwIgQU7Dr/LP7l7u5uHqSdULbBEQQ1EjAlqQF7IFxwT4AOc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18906},"main":"./dist/my-ai-chatbot.js","type":"module","module":"./dist/my-ai-chatbot.js","exports":{".":{"import":"./dist/my-ai-chatbot.js"},"./style.css":"./dist/my-ai-chatbot.css"},"gitHead":"22670b772f8e8649290f0df1dae5d14f6d53a99c","scripts":{"dev":"vite","lint":"eslint .","build":"vite build","preview":"vite preview","build:lib":"vite build --config vite.lib.config.js","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"benbassatido","email":"benbassatido@gmail.com"},"repository":{"url":"git+https://github.com/benbassatido/ai-chatbot.git","type":"git"},"_npmVersion":"11.11.0","description":"A React chat widget powered by OpenRouter AI with markdown support, RTL/LTR, localStorage persistence, and smooth animations.","directories":{},"sideEffects":["**/*.css"],"_nodeVersion":"22.15.1","dependencies":{"axios":"^1.13.6","framer-motion":"^12.38.0","react-markdown":"^10.1.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.1","react":"^19.2.4","eslint":"^9.39.4","globals":"^17.4.0","react-dom":"^19.2.4","@eslint/js":"^9.39.4","@types/react":"^19.2.14","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.5.2"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-chatbot_0.1.2_1774101009689_0.46197124164057257","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@benbassatido/ai-chatbot","version":"0.1.3","license":"MIT","_id":"@benbassatido/ai-chatbot@0.1.3","maintainers":[{"name":"benbassatido","email":"benbassatido@gmail.com"}],"homepage":"https://github.com/benbassatido/ai-chatbot","bugs":{"url":"https://github.com/benbassatido/ai-chatbot/issues"},"dist":{"shasum":"63bdcd029daef1479a6de24425996cee3b8663ce","tarball":"https://registry.npmjs.org/@benbassatido/ai-chatbot/-/ai-chatbot-0.1.3.tgz","fileCount":5,"integrity":"sha512-sVfnIQL+nyjxZF5bMINKLF6KfyFUfAvhnqIVeNAc39TSsf8nSpQTrKOiRKpGJ7Q9HECGVcywqaWoeHQ1KOvDrQ==","signatures":[{"sig":"MEUCIQCpJ7uFDseckraH3uxWbK9Md0LlVVtPNlBw2UItRUNvdAIgRTOZUwIZyqAFZKMBgnbc8I9V0yVBsvuLjDeF4vNV3zs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18436},"main":"./dist/my-ai-chatbot.js","type":"module","module":"./dist/my-ai-chatbot.js","exports":{".":{"import":"./dist/my-ai-chatbot.js"},"./style.css":"./dist/my-ai-chatbot.css"},"gitHead":"134d92d85d84a58ae7fb7ac4d1fb3d4c08b86509","scripts":{"dev":"vite","lint":"eslint .","build":"vite build","preview":"vite preview","build:lib":"vite build --config vite.lib.config.js","prepublishOnly":"npm run build:lib"},"_npmUser":{"name":"benbassatido","email":"benbassatido@gmail.com"},"repository":{"url":"git+https://github.com/benbassatido/ai-chatbot.git","type":"git"},"_npmVersion":"11.11.0","description":"A React chat widget powered by OpenRouter AI with markdown support, RTL/LTR, localStorage persistence, and smooth animations.","directories":{},"sideEffects":["**/*.css"],"_nodeVersion":"22.15.1","dependencies":{"axios":"^1.13.6","framer-motion":"^12.38.0","react-markdown":"^10.1.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.1","react":"^19.2.4","eslint":"^9.39.4","globals":"^17.4.0","react-dom":"^19.2.4","@eslint/js":"^9.39.4","@types/react":"^19.2.14","@types/react-dom":"^19.2.3","eslint-plugin-react":"^7.37.5","@vitejs/plugin-react":"^6.0.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.5.2"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ai-chatbot_0.1.3_1775982374246_0.1947781678690661","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@benbassatido/ai-chatbot","version":"0.1.4","type":"module","description":"A React chat widget powered by OpenRouter AI with markdown support, RTL/LTR, localStorage persistence, and smooth animations.","license":"MIT","main":"./dist/my-ai-chatbot.js","module":"./dist/my-ai-chatbot.js","repository":{"type":"git","url":"git+https://github.com/benbassatido/ai-chatbot.git"},"homepage":"https://github.com/benbassatido/ai-chatbot","exports":{".":{"import":"./dist/my-ai-chatbot.js"},"./style.css":"./dist/my-ai-chatbot.css"},"sideEffects":["**/*.css"],"scripts":{"dev":"vite","build":"vite build","build:lib":"vite build --config vite.lib.config.js","lint":"eslint .","preview":"vite preview","prepublishOnly":"npm run build:lib"},"peerDependencies":{"react":"^18.0.0 || ^19.0.0","react-dom":"^18.0.0 || ^19.0.0"},"dependencies":{"axios":"^1.13.6","framer-motion":"^12.38.0","react-markdown":"^10.1.0"},"devDependencies":{"@eslint/js":"^9.39.4","@types/react":"^19.2.14","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^6.0.1","eslint":"^9.39.4","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.5.2","globals":"^17.4.0","react":"^19.2.4","react-dom":"^19.2.4","vite":"^8.0.1"},"gitHead":"7689045fb2e104d2b2ddadcf24d6ff8a0a39f496","_id":"@benbassatido/ai-chatbot@0.1.4","bugs":{"url":"https://github.com/benbassatido/ai-chatbot/issues"},"_nodeVersion":"22.15.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-yueC6qSdxeQkpaBRCxU3zlIFihdrbyLqNFQU92ufuekGZsXQtGWCq4o4oFGVi/Ax+BrsHDnouyBkdbywEXo42A==","shasum":"bcf9e4c0542d581d10c433ede0fff9b8ffd6e7dd","tarball":"https://registry.npmjs.org/@benbassatido/ai-chatbot/-/ai-chatbot-0.1.4.tgz","fileCount":5,"unpackedSize":18553,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD/A83B+keIlNLSGrE+TdUiCpdLUzqb0MV+QGyMNJ73aQIhAPBcS6/91nA/KMIHHGvYzUUrriQ9UGmTYgU/udhyTxGF"}]},"_npmUser":{"name":"benbassatido","email":"benbassatido@gmail.com"},"directories":{},"maintainers":[{"name":"benbassatido","email":"benbassatido@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-chatbot_0.1.4_1775983299313_0.37464878829690096"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-21T12:53:13.893Z","modified":"2026-04-12T08:41:39.536Z","0.1.0":"2026-03-21T12:53:14.102Z","0.1.1":"2026-03-21T13:33:40.841Z","0.1.2":"2026-03-21T13:50:09.839Z","0.1.3":"2026-04-12T08:26:14.425Z","0.1.4":"2026-04-12T08:41:39.452Z"},"bugs":{"url":"https://github.com/benbassatido/ai-chatbot/issues"},"license":"MIT","homepage":"https://github.com/benbassatido/ai-chatbot","repository":{"type":"git","url":"git+https://github.com/benbassatido/ai-chatbot.git"},"description":"A React chat widget powered by OpenRouter AI with markdown support, RTL/LTR, localStorage persistence, and smooth animations.","maintainers":[{"name":"benbassatido","email":"benbassatido@gmail.com"}],"readme":"# 🤖 AI Chatbot\n\nA drop-in **React** chat widget powered by AI. Styled with **Tailwind CSS**, animated with **Framer Motion**, and renders assistant replies as **Markdown**. No API key required — the AI connection is handled for you.\n\n---\n\n## ✨ Features\n\n- 💬 Floating chat bubble with smooth open / close animation\n- 📝 Markdown rendering for assistant messages\n- 🌐 **RTL / LTR** support via a single prop\n- 💾 Optional **localStorage** persistence\n- 🎨 Customizable title, brand color, welcome text, and system prompt\n- 🏢 Pass structured **business info** so the AI stays grounded\n- 🔒 API key stays server-side — never exposed in the browser\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install @benbassatido/ai-chatbot\n```\n\n### Peer dependencies\n\nReact **18** or **19** must be installed in your project:\n\n```bash\nnpm install react react-dom\n```\n\n---\n\n## 🚀 Quick start\n\n```jsx\nimport { Chatbot } from \"@benbassatido/ai-chatbot\";\nimport \"@benbassatido/ai-chatbot/style.css\";\n\nfunction App() {\n  return (\n    <Chatbot\n      title=\"Support\"\n      brandColor=\"#1d4ed8\"\n      welcomeMessage=\"Hi! How can I help?\"\n      systemPrompt=\"You are a helpful support assistant.\"\n      direction=\"ltr\"\n      businessInfo={{\n        companyName: \"Acme\",\n        supportEmail: \"help@acme.com\",\n      }}\n    />\n  );\n}\n```\n\n---\n\n## 🎨 Styling requirements\n\nThe widget uses **Tailwind CSS** utility classes and **Google Material Symbols**. Your host page must include them for the UI to render correctly.\n\n### Tailwind CSS\n\nAdd the [Tailwind CDN](https://tailwindcss.com/docs/installation/play-cdn) (quick) or install Tailwind in your project (recommended for production):\n\n```html\n<script src=\"https://cdn.tailwindcss.com\"></script>\n```\n\nThen extend your Tailwind theme with the colors the widget expects:\n\n```js\ntailwind.config = {\n  theme: {\n    extend: {\n      colors: {\n        primary: \"#004ac6\",\n        \"primary-container\": \"#2563eb\",\n        surface: \"#f8f9fa\",\n        \"surface-container-lowest\": \"#ffffff\",\n        \"surface-container-high\": \"#e8eaed\",\n        \"on-surface\": \"#191c1d\",\n        \"on-primary\": \"#ffffff\",\n        \"outline-variant\": \"#c3c6d7\",\n        error: \"#dc2626\",\n      },\n    },\n  },\n};\n```\n\n### Fonts\n\n```html\n<!-- Inter -->\n<link\n  href=\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\"\n  rel=\"stylesheet\"\n/>\n\n<!-- Material Symbols Outlined -->\n<link\n  href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap\"\n  rel=\"stylesheet\"\n/>\n```\n\n---\n\n## 🎛️ Props\n\n| Prop | Type | Default | Description |\n| ---- | ---- | ------- | ----------- |\n| `title` | `string` | — | Header text displayed in the chat window |\n| `brandColor` | `string` | — | CSS color for the header background |\n| `welcomeMessage` | `string` | — | First message shown by the assistant |\n| `systemPrompt` | `string` | built-in | System prompt sent to the AI model |\n| `businessInfo` | `object` | — | Arbitrary business data injected into the system prompt |\n| `direction` | `\"ltr\" \\| \"rtl\"` | `\"ltr\"` | Text direction |\n| `storageMode` | `\"localStorage\" \\| \"controlled\"` | `\"localStorage\"` | How messages are persisted |\n| `storageKey` | `string` | `\"chatbot_messages\"` | localStorage key when `storageMode` is `\"localStorage\"` |\n| `messages` | `array` | — | Controlled messages array (used with `storageMode=\"controlled\"`) |\n| `onMessagesChange` | `function` | — | Callback when messages update in controlled mode |\n\n---\n\n## 🧱 Tech stack\n\n| Layer | Choice |\n| ----- | ------ |\n| UI | React 19, CSS Modules, Tailwind CSS |\n| Motion | Framer Motion |\n| Markdown | react-markdown |\n| HTTP | axios |\n| AI API | OpenRouter (via backend proxy) |\n| Tooling | Vite 8, ESLint 9 |\n\n---\n\n## 📄 License\n\n[MIT](./LICENSE)\n\n---\n\n## 🙏 Acknowledgments\n\n- [OpenRouter](https://openrouter.ai/) for the AI API\n- [Vite](https://vite.dev/) for the build tooling\n- [Framer Motion](https://motion.dev/) for animations\n","readmeFilename":"README.md"}