Package Exports
- @chitrank2050/ask-widget
- @chitrank2050/ask-widget/style.css
- @chitrank2050/ask-widget/styles.css
Readme
ask-widget 🤖
A state-of-the-art, lightweight chat widget for developer portfolios. Powered by Vite 8 and the Rolldown engine for sub-5KB performance and perfect CSS isolation.
🚀 2027 Tech Stack
This project is built for the future of the web:
- Engine: Vite 8 + Rolldown (Rust-powered performance)
- Compiler: SWC (Sub-millisecond React transformation)
- CSS: Cascade Layers (
@layer) + HSL Tokens (Zero global collisions) - Runtime: Dual ESM/CJS (Native support for Node, Bun, and Deno)
- Security: SLSA Level 3 Provenance + Gitleaks protection
✨ Features
- SSE Streaming: Built-in support for OpenAI-compatible streaming backends.
- Themeable: Zinc-based design system with easy HSL overrides.
- Persistence: Built-in session persistence across page reloads.
📖 Documentation & Demo
- Live Demo: ask-widget.chitrankagnihotri.com
- API Reference: Automated Docs
- Theming Guide: Customizing Zinc
📦 Quick Start
pnpm add @chitrank2050/ask-widgetimport { ChatWidget } from '@chitrank2050/ask-widget';
import '@chitrank2050/ask-widget/style.css'; // Optimized CSS Layer styles
export default function App() {
return (
<ChatWidget
apiUrl="https://your-api.example.com"
apiToken={import.meta.env.VITE_CHAT_API_TOKEN}
title="Ask AI"
/>
);
}🛠️ Development
We use pnpm and Lefthook for a high-performance developer workflow.
# Install and setup
pnpm install
pnpm exec lefthook install
# Run dev server
pnpm dev
# Run automated tests (Vitest + SWC)
pnpm run test:coverage🚀 Release Process
We use a two-phase automated release pipeline powered by git-hygiene.
- Prepare: Run the
Release 1 - Prepare PRworkflow. It bumps the version inpackage.json, updatesCHANGELOG.md, and opens a PR. - Finalize: Merge the PR to
main. TheRelease 2 - Finalize Tagworkflow will automatically tag the release, create a GitHub Release, and publish to NPM.
🛡️ Security & Quality
- Secret Scanning: Gitleaks prevents credential leaks in every commit.
- Workflow Auditing: Zizmor ensures GitHub Actions follow security best practices.
- Supply Chain: All GitHub Actions are pinned to secure commit SHAs.
- Provenace: Automated build attestations for every release.
Developed with ❤️ by Chitrank Agnihotri
If you use this in your project, a credit or star is appreciated. ✨