This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
FlowiseChatEmbed is a JavaScript library that provides embeddable chatbot widgets for Flowise. It builds to a single bundled JS file that consumers load via <script> tag. The library registers two custom web components (<flowise-chatbot> for popup, <flowise-fullchatbot> for full-page) and exposes Chatbot.init() / Chatbot.initFull() / Chatbot.destroy() APIs.
yarn install # Install dependencies
yarn dev # Dev server with livereload at http://localhost:5678
yarn build # Production build to dist/
yarn lint # ESLint check
yarn lint-fix # ESLint auto-fix
yarn format # Prettier format
yarn format:check # Prettier check
yarn start # Start Express proxy server on port 3001There are no tests in this project.
This project uses SolidJS with solid-element for web component registration. JSX compiles via babel-preset-solid, not React. SolidJS uses fine-grained reactivity (createSignal, createEffect, createMemo) instead of virtual DOM diffing. Components use <Show>, <For>, <Switch>/<Match> control flow components.
Rollup bundles from src/web.ts into two outputs:
dist/web.js(ES module) — primary consumer formatdist/web.umd.js(UMD, globalFlowiseEmbed)
CSS is processed via PostCSS with Tailwind CSS (rem-to-px converted in tailwind.config.cjs) and injected inline (not extracted).
src/web.ts → registerWebComponents() (registers custom elements via solid-element) → parseChatbot() (creates init/initFull/destroy API) → injectChatbotInWindow() (sets window.Chatbot)
src/components/Bot.tsx— Core chatbot logic (~800 lines). Manages messages, streaming (SSE via@microsoft/fetch-event-source), file uploads, audio recording, lead capture, feedback, and chat history persistence via localStorage.src/features/bubble/— Popup bubble mode: floating button + tooltip + chat windowsrc/features/full/— Full-page modesrc/features/popup/— Disclaimer popup and modal overlayssrc/queries/sendMessageQuery.ts— All Flowise API calls (prediction, streaming, feedback, TTS, file upload, lead capture)src/utils/index.ts— HTTP request helper (sendRequest), localStorage helpers, cookie utilssrc/features/bubble/types.ts— Theme/config type definitions (BubbleTheme,ChatWindowTheme,ButtonTheme, etc.)src/constants.ts— Default props
server.js is an Express server that proxies requests to a Flowise instance, hiding API keys and chatflow IDs from the client. Chatflow mappings are configured via environment variables (see .env.example). This is a separate runtime from the embedded widget.
TypeScript uses @/* → src/* (configured in tsconfig.json, resolved by rollup-plugin-typescript-paths).
Tailwind CSS with @tailwindcss/typography plugin. The Tailwind config converts all rem values to px (since the widget runs inside arbitrary host pages where root font-size varies). Styles are bundled inline, not extracted to a separate CSS file.