Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

ai-chat-frontend

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-chat-frontend

A framework-agnostic, premium AI Chat Web Component with Shadow DOM encapsulation and SSE streaming support.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

ai-chat-frontend

A framework-agnostic, premium AI Chat Web Component built with Lit. Perfect for integrating agentic AI into any project (React, Angular, Vue, or Vanilla JS).

Features

  • 🚀 SSE Streaming: Natively supports server-sent events for a smooth "typing" experience.
  • 🎨 Premium UI: Modern dark theme with glassmorphism and subtle micro-animations.
  • 🛡️ Style Isolation: Shadow DOM encapsulation ensures styles don't conflict with your host app.
  • 📦 Lightweight: Minimal footprint and zero external CSS requirements.
  • 🔄 Persistence: Automatic local storage of chat history and sessions.
  • 📝 Markdown: Built-in support for rich text, code blocks, and lists.

Installation

npm install ai-chat-frontend

Usage

Vanilla HTML

<script type="module">
  import 'ai-chat-frontend';
</script>

<ai-chat-widget 
  api-url="https://api.your-system.com/chat"
  title="Assistant"
  placeholder="Ask me anything..."
></ai-chat-widget>

React

import 'ai-chat-frontend';

function App() {
  return (
    <ai-chat-widget 
      api-url="/api/v1/chat"
      user-id="user-123"
      auth-token="secret-token"
    />
  );
}

Angular

  • Add CUSTOM_ELEMENT_SCHEMA to your module.
  • Import the library in main.ts:
import 'ai-chat-frontend';

API Reference

Attributes

AttributeTypeDefaultDescription
api-urlstring''Required. The endpoint for chat requests.
auth-tokenstring''Optional JWT or auth token for the request header.
user-idstring'guest'Used for persistent local storage keys.
titlestring'AI Assistant'The title displayed in the chat header.
placeholderstring'Ask me...'Placeholder text for the input field.

Events

EventDescription
message-sentEmitted when the user sends a message.
session-updatedEmitted when a new X-Session-ID is received.

License

MIT © Performance Tracker Team

Keywords

ai-chat

FAQs

Package last updated on 21 Apr 2026

Did you know?

Socket

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.

Install

Related posts