
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
ai-chat-widget-react
Advanced tools
Embeddable multi-language chat + voice assistant widget. Single script tag embed, customizable via `window.AgentWidgetConfig`. Backend powered by Vercel AI SDK with Google's Gemini.
Embeddable multi-language chat + voice assistant widget. Single script tag embed, customizable via window.AgentWidgetConfig. Backend powered by Vercel AI SDK with Google's Gemini.
npm install.env.example to .env and set GOOGLE_GENERATIVE_AI_API_KEYnpm run dev:server (Express on http://localhost:8788)npm run dev (Vite on http://localhost:5173)http://localhost:5173 (default Vite app) — the widget auto-mounts on any page including this one.npm run build
npm run preview
# then open http://localhost:4173/embed-test.html
The bundle is emitted as dist/agent-widget.js. Embed it on any site:
<script>
window.AgentWidgetConfig = {
position: "bottom-right",
theme: { primaryColor: "#4F46E5" },
agent: { name: "HelperBot", avatar: "https://example.com/avatar.png" },
enableVoice: true,
languageOptions: ["en", "hi", "es"],
context: "You are a front-end expert",
};
</script>
<script src="https://your-cdn/agent-widget.js"></script>
/api/chat with JSON body: { messages: {role, content}[], context?: string, lang?: string }server/index.ts).api/chat.ts serverless function.position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'theme: primaryColor, backgroundColor, textColor, fontFamilyagent: name, avatarenableVoice: booleanlanguageOptions: e.g. ['en','hi','es']context: string passed to the LLM each requestai, @ai-sdk/google) with Gemini (gemini-1.5-flash)Approach and architecture notes: [link-to-notion]
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(["dist"]),
{
files: ["**/*.{ts,tsx}"],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
]);
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from "eslint-plugin-react-x";
import reactDom from "eslint-plugin-react-dom";
export default defineConfig([
globalIgnores(["dist"]),
{
files: ["**/*.{ts,tsx}"],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs["recommended-typescript"],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
]);
FAQs
Embeddable multi-language chat + voice assistant widget. Single script tag embed, customizable via `window.AgentWidgetConfig`. Backend powered by Vercel AI SDK with Google's Gemini.
We found that ai-chat-widget-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.