JSPM

@chitrank2050/ask-widget

0.6.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q65511F
  • License MIT

Package Exports

  • @chitrank2050/ask-widget
  • @chitrank2050/ask-widget/style.css
  • @chitrank2050/ask-widget/styles.css

Readme

ask-widget logo


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.

npm JSR

CI 🌊 codecov OpenSSF Best Practices Scorecard Status OpenSSF Scorecard Security: Gitleaks SLSA Level 3 License

Buy me a coffee at ko-fi.com


🚀 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


📦 Quick Start

pnpm add @chitrank2050/ask-widget
import { 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.

  1. Prepare: Run the Release 1 - Prepare PR workflow. It bumps the version in package.json, updates CHANGELOG.md, and opens a PR.
  2. Finalize: Merge the PR to main. The Release 2 - Finalize Tag workflow 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.