ikon-ai-component
v1.0.7
Published
IkonAI agentic chat component
Readme
This is an npm package — a collection of AI-powered UI components for Next.js applications built by Keross.
Getting Started
Install the package and its peer dependencies:
npm install ikon-ai-component
# peer deps (if not already installed)
npm install react react-dom next next-themesImport the stylesheet once in your root CSS:
@import "ikon-ai-component/dist/styles.css";You can start using components by importing them from the package:
import { GlobalChatWidget } from "ikon-ai-component"Required environment variables
The chat widget needs three env vars, set in the consuming app (.env, Docker ENV, or K8s ConfigMap).
They must be present or the widget will not work — see the fail-fast setup below.
| Variable | Example | Used for |
|---|---|---|
| NEXT_PUBLIC_AI_WORKFORCE_BACKEND_URL | https://portal.ikon.keross.com/ikon-ai-workforce/backend-api | Data-service base URL (passed as the backendUrl prop) |
| NEXT_PUBLIC_SOCKET_URL | https://portal.ikon.keross.com | Chat Socket.IO origin |
| NEXT_PUBLIC_IKON_AI_WORKFORCE_CHAT_SERVICE_BASE_PATH | /ikon-ai-workforce-chat-service | Ingress path prefix for the socket endpoint |
See .env.example.
If any variable is missing, the widget throws a clear, named error when it renders — no setup or extra wiring required. In a Next.js app with dynamic pages this surfaces at runtime (dev overlay / page load); in a React app rendered during an SSR/prerender build it surfaces at build time.
Learn More
To learn more about the technologies used in this package, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Socket.IO Documentation - real-time event-based communication.
- Tailwind CSS Documentation - utility-first CSS framework.
- React Markdown - Markdown rendering in React.
- Monaco Editor - code editor used for syntax highlighting.
Build
To build the package from source:
npm run build
# or just TypeScript
npm run build:js
# or just CSS
npm run build:cssOutput goes to dist/.
Publish
To publish a new version to npm:
npm version patch # or minor / major
npm publishThe prepublishOnly script runs npm run build automatically before publishing.
