OpenWebUI TypeScript Embedded SDK
January 29, 2026 ยท View on GitHub
Modern Angular 20 library for embedding OpenWebUI chat in your applications with full conversation history, markdown support, and Angular 2025 architecture.
๐ Live Demo
Interactive demo showcasing all features:
- Dynamic configuration
- Model selection
- Real-time chat with conversation history
- Markdown rendering
- Multi-language support
๐ How to Use the Application
Quick Start Guide
Step 1: Initial Configuration
When you first launch the application, enter your OpenWebUI server details:

Required:
- Host URL - Your OpenWebUI server address (e.g.,
http://localhost:8080) - API Key - Your API authentication key
Step 2: Load Available Models
Click "Show Models" to fetch the list of AI models from your server:

Step 3: Select Your Model
Choose an AI model from the dropdown menu:

Step 4: Connect to Chat
Click "Connect Chat" to initialize your chat session:

Step 5: Start Chatting
Type your message and click "Send" or press Enter:

Features:
- View all conversations
- Organize chats into folders
- Pin important chats
- Search through history
- Archive old conversations
- Export chats (PDF, TXT, JSON)
๐ Notes Management
Create and manage notes with a built-in markdown editor:

Features:
- Rich markdown editor
- Auto-save functionality
- Search through notes
- Reference notes in chats
- Organize with folders
โจ Features
- ๐ Angular 2025 Ready - Zoneless, Signals, Modern file structure
- ๐ฌ Conversation History - AI remembers all previous messages
- ๐ Markdown Support - Rich text rendering with ngx-markdown
- โก Signals & Zoneless - Latest Angular reactive patterns
- ๐ก Streaming Responses - Real-time chat with typing indicator
- โน๏ธ Stop Generation - Cancel AI response at any time
- ๐ค Voice Input - Record audio messages with automatic transcription
- ๐ Multi-language - 10 languages supported
- ๐จ Customizable - SCSS with modern features
- ๐ง TypeScript - Full type safety
- ๐ฑ Responsive - Mobile-friendly design
- โญ Response Actions - Continue, regenerate, and rate responses
- ๐ Rating System - Comprehensive feedback with good/bad ratings
- ๐ค Chat Export - Download conversations as PDF, TXT, or JSON
- ๐ก๏ธ Safe Deletion - Prevents accidental deletion of active chats
- ๐ฌ Ask & Explain - Context menu for selected text with AI explanations
- ๐ Folder Support - Organize chats into folders with drag & drop
- ๐ Notes Support - Integrated markdown note editor with sidebar
- ๐๏ธ Archived Chats - View, search, unarchive, and delete archived conversations
- ๐ Integrations - Toggle Web Search and Code Interpreter capabilities
- ๐ ๏ธ Tools Support - Access and enable server-side tools from Open WebUI API
- ๐ฌ Reference Chats - Reference previous conversations in new messages
- ๐ Reference Notes - Reference notes in new messages
- ๐ Web Page Attachment - Process and attach web page content to messages
- ๐๏ธ Feature Toggles - Conditional display of advanced features
๐ Quick Start
Installation
npm install ngx-open-web-ui-chat
Setup
1. Configure Bootstrap (main.ts)
import { bootstrapApplication } from '@angular/platform-browser';
import { provideZonelessChangeDetection } from '@angular/core';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { provideMarkdown } from 'ngx-markdown';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent, {
providers: [
provideZonelessChangeDetection(), // Zoneless mode!
provideHttpClient(withInterceptorsFromDi()),
provideMarkdown() // For markdown rendering
]
}).catch((err) => console.error(err));
2. Use Component
import { Component } from '@angular/core';
import { OpenwebuiChatComponent } from 'ngx-open-web-ui-chat';
@Component({
standalone: true,
imports: [OpenwebuiChatComponent],
template: `
<openwebui-chat
[endpoint]="'https://your-openwebui-instance.com'"
[modelId]="'llama3'"
[apiKey]="'sk-your-api-key'">
</openwebui-chat>
`
})
export class AppComponent {}
๐ Key Concepts
Conversation History
The component automatically maintains conversation context:
[
{"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi! How can I help?"},
{"role": "user", "content": "What did I just say?"},
{"role": "assistant", "content": "You said 'Hello'"}
]
Features:
- โ Full conversation history sent with each request
- โ AI remembers all previous messages
- โ Context-aware responses
Angular 2025 Architecture
Zoneless Change Detection:
provideZonelessChangeDetection() // No ZoneJS!
Signals for State:
messages = signal<ChatMessage[]>([]);
isLoading = signal(false);
Modern File Structure:
components/
โโโ openwebui-chat.ts โ Logic
โโโ openwebui-chat.html โ Template
โโโ openwebui-chat.scss โ Styles (SCSS!)
๐ Project Structure
openwebui-ts-embedded-sdk/
โโโ projects/
โ โโโ ngx-open-web-ui-chat/ # Library package
โ โโโ src/lib/
โ โ โโโ components/
โ โ โ โโโ openwebui-chat.ts
โ โ โ โโโ openwebui-chat.html
โ โ โ โโโ openwebui-chat.scss
โ โ โ โโโ chat-input/
โ โ โ โโโ chat-message/
โ โ โ โโโ chat-history-sidebar/
โ โ โ โ โโโ sidebar/
โ โ โ โ โโโ list/
โ โ โ โ โโโ item/
โ โ โ โ โโโ header/
โ โ โ โ โโโ context-menu/
โ โ โ โ โโโ folder-list/
โ โ โ โ โโโ folder-item/
โ โ โ โ โโโ folder-context-menu/
โ โ โ โโโ archived-chats-modal/ โ Archived chats modal
โ โ โ โโโ attach-webpage-modal/ โ Web page attachment modal
โ โ โ โโโ note-editor/ โ Note editor component
โ โ โ โโโ notes-sidebar/ โ Notes sidebar component
โ โ โ โโโ tools-menu/ โ Tools selection submenu
โ โ โ โโโ chat-search-modal/
โ โ โ โโโ confirm-dialog/
โ โ โ โโโ error-banner/
โ โ โ โโโ export-format-menu/
โ โ โ โโโ message-actions/
โ โ โ โโโ rating-form/
โ โ โ โโโ regenerate-menu/
โ โ โ โโโ text-selection-menu/
โ โ โ โโโ ask-explain-modal/
โ โ โโโ services/
โ โ โ โโโ openwebui-api.ts
โ โ โโโ models/
โ โ โ โโโ chat.model.ts
โ โ โโโ utils/
โ โ โ โโโ audio-recorder.ts
โ โ โ โโโ date-formatter.ts
โ โ โโโ i18n/
โ โ โโโ translations.ts
โ โโโ dist/ # Built package
โโโ test-app/ # Test application
โ โโโ src/app/
โ โ โโโ app.component.ts
โ โ โโโ app.component.html
โ โ โโโ app.component.scss
โ โโโ package.json
โโโ docs/ # Documentation
โ โโโ API.md
โ โโโ I18N.md
โ โโโ MARKDOWN.md
โ โโโ CHANGELOG.md
โโโ README.md # This file
โโโ package.json
๐ฏ API Reference
Inputs
| Input | Type | Required | Default | Description |
|---|---|---|---|---|
endpoint | string | โ | - | OpenWebUI instance URL |
modelId | string | โ | - | AI model identifier |
apiKey | string | โ | - | API key |
enableMarkdown | boolean | โ | true | Enable markdown |
debug | boolean | โ | false | Debug logging |
language | string | โ | 'en' | UI language |
history | boolean | โ | false | Enable chat history sidebar |
folders | boolean | โ | false | Enable folder support |
notes | boolean | โ | false | Enable notes feature |
integrations | boolean | โ | false | Enable integrations support |
tools | boolean | โ | false | Enable tools selection menu |
showReferenceChats | boolean | โ | false | Enable reference chat selection |
showReferenceNotes | boolean | โ | false | Enable reference note selection |
showAttachWebPage | boolean | โ | false | Enable web page attachment feature |
Outputs
| Output | Type | Description |
|---|---|---|
chatInitialized | EventEmitter<void> | Chat session ready |
messagesChanged | EventEmitter<number> | Message count changed |
Methods
| Method | Description |
|---|---|
sendMessage(message: string) | Send a message programmatically |
stopGeneration() | Stop current AI response generation |
clearChat() | Clear all messages |
createNewChat() | Create new chat session |
changeModel(modelId: string) | Switch to different model |
๐ ๏ธ Development
Build Library
cd projects/ngx-open-web-ui-chat
npm run build
Output: projects/ngx-open-web-ui-chat/dist/
Test Application
cd test-app
npm start
Visit: http://localhost:4200
Features:
- Dynamic host & API key configuration
- Model selection
- Progressive connection flow
- Chat controls (clear, disconnect, language)
- Beautiful UI with step-by-step guide
๐ Documentation
| Document | Description |
|---|---|
| API Reference | Complete API documentation |
| Markdown Guide | Markdown features & examples |
| I18N Guide | Multi-language support |
๐ง Technology Stack
- Angular 20.x - Latest framework with signals
- TypeScript 5.8 - Full type safety
- ng-packagr - Library packaging
- ngx-markdown - Markdown rendering
- RxJS - Only for streaming (Angular 2025 pattern)
- SCSS - Modern styling with nesting
๐๏ธ Angular 2025 Features
โ
Zoneless Change Detection - No ZoneJS overhead
โ
Signals - Reactive state management
โ
Standalone Components - No NgModules
โ
Modern File Structure - Separated TS/HTML/SCSS
โ
inject() DI - Modern dependency injection
โ
Async/Await - Instead of Observable where appropriate
โ
Computed Properties - Derived state
๐จ Examples
Basic Usage
<openwebui-chat
[endpoint]="'https://ai.example.com'"
[modelId]="'llama3'"
[apiKey]="'sk-abc123'">
</openwebui-chat>
With Controls
import { Component, ViewChild } from '@angular/core';
import { OpenwebuiChatComponent } from 'ngx-open-web-ui-chat';
@Component({
template: `
<button (click)="clearChat()">Clear</button>
<button (click)="sendGreeting()">Say Hi</button>
<openwebui-chat
#chat
[endpoint]="endpoint"
[modelId]="modelId"
[apiKey]="apiKey"
(messagesChanged)="onMessageCount($event)">
</openwebui-chat>
<p>Messages: {{ messageCount }}</p>
`
})
export class AppComponent {
@ViewChild('chat') chat?: OpenwebuiChatComponent;
messageCount = 0;
clearChat() {
this.chat?.clearChat();
}
sendGreeting() {
this.chat?.sendMessage('Hello!');
}
onMessageCount(count: number) {
this.messageCount = count;
}
}
Multi-language
<openwebui-chat
[endpoint]="endpoint"
[modelId]="modelId"
[apiKey]="apiKey"
[language]="'en'">
</openwebui-chat>
Supported languages: en, zh, hi, es, ar, fr, pt, ru, bn, ja
๐ Publishing
# 1. Build
cd projects/ngx-open-web-ui-chat
npm run build
# 2. Publish
cd dist
npm publish --access public
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make changes
- Test thoroughly
- Submit pull request
๐ License
MIT License - see LICENSE file for details
๐ Best Practices Implemented
- โ Angular 2025 Architecture - Zoneless, signals, modern patterns
- โ Separation of Concerns - TS/HTML/SCSS files
- โ Type Safety - Full TypeScript strict mode
- โ SCSS Features - Nesting, variables, modern CSS
- โ Conversation Context - Full history maintained
- โ Event-Driven - Reactive communication
- โ Responsive Design - Mobile-friendly
- โ Clean Code - Following Angular style guide
๐ฎ Roadmap
Completed Features โ
- โ Conversation history with full context
- โ Real-time streaming with Socket.IO
- โ File upload support
- โ Voice input with transcription
- โ Response actions (continue, regenerate, rate)
- โ Chat export (PDF, TXT, JSON)
- โ Folder organization with drag & drop
- โ Notes with markdown editor
- โ Archived chats management
- โ Tools integration
- โ Reference chats and notes
- โ Web search & code interpreter
- โ Multi-language support (10 languages)
- โ Web page attachment with content processing
- โ Conditional feature display with toggles
Planned Features ๐
- Image generation support
- Voice output (TTS)
- Custom themes
- Plugin system
- Collaborative chats
- Advanced search filters
- Chat templates
- Keyboard shortcuts
Status: Production-ready v1.1.0
Angular Version: 20.x
Node Required: >=20.19.0
TypeScript: ~5.8.0
Made with โค๏ธ using Angular 2025 architecture