{"_id":"@astralibx/chat-widget","_rev":"6-520584cb58c8cac39dd3f703c83751e0","name":"@astralibx/chat-widget","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.1":{"name":"@astralibx/chat-widget","version":"0.1.1","license":"MIT","_id":"@astralibx/chat-widget@0.1.1","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"72d4557c7407191487a95c2ce41b0de9b0fe5a1a","tarball":"https://registry.npmjs.org/@astralibx/chat-widget/-/chat-widget-0.1.1.tgz","fileCount":4,"integrity":"sha512-PWmQpLZQThHrZ/jCNC+xOotE13Jp6uS/MSayJ1tWCgdb5vhco6D+M66Fq+zyu3fI2S0UTXd/ZzLChTKHixrzCA==","signatures":[{"sig":"MEQCIHBeMshDVRNYB8MhTi68ZDdj26nx9KzLDI6VrPzP4cLLAiASZiMCCntGjDE3MtfbSXbzj1U6nBTdoojW2SPwFi0MVQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":426427},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"df956e4b9f30b71fc0ee0eba6b811eee2092bf52","scripts":{"dev":"vite","test":"vitest run","build":"vite build"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/chat/chat-widget"},"_npmVersion":"10.9.4","description":"Embeddable visitor-facing chat widget built with Lit Web Components","directories":{},"_nodeVersion":"22.22.1","dependencies":{"lit":"^3.0.0","@astralibx/chat-types":"^0.1.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^3.0.0","typescript":"^5.8.0","socket.io-client":"^4.0.0"},"peerDependencies":{"socket.io-client":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-widget_0.1.1_1773730923358_0.5456141705498816","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@astralibx/chat-widget","version":"0.1.2","license":"MIT","_id":"@astralibx/chat-widget@0.1.2","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"2004f08e57398b6049f2c64fdfa63a909826045e","tarball":"https://registry.npmjs.org/@astralibx/chat-widget/-/chat-widget-0.1.2.tgz","fileCount":4,"integrity":"sha512-TNlnqjwtfanMrcNLSA+UOuDWImlH85Dc4UgAL8Wv0l2JMfiu7dnyiWrkSz9YH2PKLSrI0/9QzWXJhjiv8aX/CA==","signatures":[{"sig":"MEQCIAYm/FEyOfuX5eYs1ssy0VwdRiXKvU9Dx/yvIqqYimZWAiBILapgQpmu2/lWFug7QshwTSHrT9PVzBIzqOYnO3tDbg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":426958},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"fd42f0db8c9fd08982aee61f94304819cd425d54","scripts":{"dev":"vite","test":"vitest run","build":"vite build"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/chat/chat-widget"},"_npmVersion":"10.9.4","description":"Embeddable visitor-facing chat widget built with Lit Web Components","directories":{},"_nodeVersion":"22.22.1","dependencies":{"lit":"^3.0.0","@astralibx/chat-types":"^0.1.2"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^3.0.0","typescript":"^5.8.0","socket.io-client":"^4.0.0"},"peerDependencies":{"socket.io-client":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-widget_0.1.2_1773733706498_0.03087554604313314","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@astralibx/chat-widget","version":"0.2.0","license":"MIT","_id":"@astralibx/chat-widget@0.2.0","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"d3533aaf0dd1f4e80f1a16a78093199b5bdb9eeb","tarball":"https://registry.npmjs.org/@astralibx/chat-widget/-/chat-widget-0.2.0.tgz","fileCount":4,"integrity":"sha512-tgFqPehR9yuxkml5PrzEwVyTFYjtdOw8Y3l0sP3ZYZchaeqNs/n7usyndSzCrlRkoCySPDLUoWmsQYEFcki9sw==","signatures":[{"sig":"MEUCIHjow+vG9i6GlbDEzo8w9sUPpHetSptaaFlKNtsn6pNVAiEAz9PjGikBBsRijDbFcF4ZQi3FE9kAIxRb1fDuhneyfd4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":542021},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"b96fb6e63feccf19591d627ddda0c3d04f165ad2","scripts":{"dev":"vite","test":"vitest run","build":"vite build"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/chat/chat-widget"},"_npmVersion":"10.9.4","description":"Embeddable visitor-facing chat widget built with Lit Web Components","directories":{},"_nodeVersion":"22.22.1","dependencies":{"lit":"^3.0.0","@astralibx/chat-types":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^3.0.0","typescript":"^5.8.0","socket.io-client":"^4.0.0"},"peerDependencies":{"socket.io-client":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-widget_0.2.0_1773814059458_0.023590158722082144","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@astralibx/chat-widget","version":"0.2.1","license":"MIT","_id":"@astralibx/chat-widget@0.2.1","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"9a0b98401e52d3569f5f31f723d30f4b2f221d8c","tarball":"https://registry.npmjs.org/@astralibx/chat-widget/-/chat-widget-0.2.1.tgz","fileCount":4,"integrity":"sha512-ii+G5CMOV/FSBCl5WHey7riQJy7ixr+WVzhyoumvGVPSPlOlpZ+1pwBkApQAO6IonKC8FQDrr/F5owbn1ZJa/A==","signatures":[{"sig":"MEYCIQCRnWUrA+ln82tVVinUtQRumy4XvgZIzIb6Y8JXrfcQAwIhAMoxp0jiI0oimgm+9W3Hfj9DuiJe2trILahJggcihhh8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":542438},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"ae1365ff1004be6b7ef07ac5ca5a5d6d8d9a6fa6","scripts":{"dev":"vite","test":"vitest run","build":"vite build"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/chat/chat-widget"},"_npmVersion":"10.9.4","description":"Embeddable visitor-facing chat widget built with Lit Web Components","directories":{},"_nodeVersion":"22.22.1","dependencies":{"lit":"^3.0.0","@astralibx/chat-types":"^0.3.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^3.0.0","typescript":"^5.8.0","socket.io-client":"^4.0.0"},"peerDependencies":{"socket.io-client":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-widget_0.2.1_1773917001401_0.27861974732862005","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@astralibx/chat-widget","version":"0.3.0","license":"MIT","_id":"@astralibx/chat-widget@0.3.0","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"9cda76ea8de54ce9bb5f84b584c4720b40c05625","tarball":"https://registry.npmjs.org/@astralibx/chat-widget/-/chat-widget-0.3.0.tgz","fileCount":4,"integrity":"sha512-mXBZIXsKux0NejAqK5ecKsrrgn8pVH5ajwJ67nYdMjGOuX9GLyl1IrYoyAGFqi6LdSdom71EegzTmn4gHNEBEg==","signatures":[{"sig":"MEQCIHSYLfQeFBOdkkItB3pgyc3dDALFVnrvQEL+KgEXHS4RAiAcNiM97J6mK27L8MIN9IA41TxWeA56MejvkY8GxcHHXQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":679970},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"4d2a55b3968e55f083d4a957eb2319acb1fa5ba3","scripts":{"dev":"vite","test":"vitest run","build":"vite build"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/chat/chat-widget"},"_npmVersion":"10.9.4","description":"Embeddable visitor-facing chat widget built with Lit Web Components","directories":{},"_nodeVersion":"22.22.1","dependencies":{"lit":"^3.0.0","@astralibx/chat-types":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^3.0.0","typescript":"^5.8.0","socket.io-client":"^4.0.0"},"peerDependencies":{"socket.io-client":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-widget_0.3.0_1773998151381_0.40361483556394906","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@astralibx/chat-widget","version":"0.3.1","description":"Embeddable visitor-facing chat widget built with Lit Web Components","repository":{"type":"git","url":"git+https://github.com/Hariprakash1997/astralib.git","directory":"packages/chat/chat-widget"},"type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"vite build","dev":"vite","test":"vitest run"},"dependencies":{"lit":"^3.0.0","@astralibx/chat-types":"^0.4.0"},"peerDependencies":{"socket.io-client":"^4.0.0"},"devDependencies":{"socket.io-client":"^4.0.0","vite":"^6.0.0","typescript":"^5.8.0","vitest":"^3.0.0"},"license":"MIT","_id":"@astralibx/chat-widget@0.3.1","gitHead":"18ae0348539bf3644ee008d3c122bd39abff0db4","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"homepage":"https://github.com/Hariprakash1997/astralib#readme","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-tQdivjzWF2Tgu89Y16h5dpVcm2aEtOR2rX0bJJMpi6/1AVW3Um33f3KZZ8tVMyxQC1CkDL7F13q5rz0i3zEkNQ==","shasum":"d4292b8e6823cd31afef4f2517c5674f30fd2af8","tarball":"https://registry.npmjs.org/@astralibx/chat-widget/-/chat-widget-0.3.1.tgz","fileCount":4,"unpackedSize":686991,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDG0DOJsYCArBc/qlUP6X4Za+Nswb0D0W4VtP5o/5Y5xwIhALCKp7tRruzHIZ03FToUTNuynsin7BQaCe/uFacy5MB0"}]},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"directories":{},"maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chat-widget_0.3.1_1774259917147_0.16550645778124773"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-17T07:02:03.290Z","modified":"2026-03-23T09:58:37.439Z","0.1.1":"2026-03-17T07:02:03.539Z","0.1.2":"2026-03-17T07:48:26.640Z","0.2.0":"2026-03-18T06:07:39.606Z","0.2.1":"2026-03-19T10:43:21.550Z","0.3.0":"2026-03-20T09:15:51.541Z","0.3.1":"2026-03-23T09:58:37.296Z"},"bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"license":"MIT","homepage":"https://github.com/Hariprakash1997/astralib#readme","repository":{"type":"git","url":"git+https://github.com/Hariprakash1997/astralib.git","directory":"packages/chat/chat-widget"},"description":"Embeddable visitor-facing chat widget built with Lit Web Components","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"readme":"# @astralibx/chat-widget\n\n[![npm version](https://img.shields.io/npm/v/@astralibx/chat-widget.svg)](https://www.npmjs.com/package/@astralibx/chat-widget)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nEmbeddable visitor-facing chat widget built with [Lit](https://lit.dev/) Web Components. Framework-agnostic -- works in React, Vue, Angular, or vanilla HTML. Includes a configurable pre-chat funnel (welcome, FAQ, guided questions, form, agent selector), offline handling, post-chat feedback, theming, and real-time events.\n\n## Install\n\n```bash\nnpm install @astralibx/chat-widget\n```\n\n### Peer Dependencies\n\n| Package | Required |\n|---------|----------|\n| `socket.io-client` | Yes (`^4.0.0`) |\n\n```bash\nnpm install socket.io-client\n```\n\n## Quick Start\n\n### HTML\n\n```html\n<script type=\"module\">\n  import '@astralibx/chat-widget';\n</script>\n\n<alx-chat-widget\n  socket-url=\"https://chat.example.com\"\n  channel=\"website\"\n  theme=\"dark\"\n  position=\"bottom-right\"\n></alx-chat-widget>\n```\n\n### Programmatic\n\n```ts\nimport { AlxChatWidget } from '@astralibx/chat-widget';\n\nconst widget = document.querySelector('alx-chat-widget') as AlxChatWidget;\nwidget.configure({\n  socketUrl: 'https://chat.example.com',\n  channel: 'website',\n  theme: 'auto',  // 'dark' | 'light' | 'auto' (follows OS preference)\n  position: 'bottom-right',\n  user: { userId: '123', name: 'John', email: 'john@example.com' },\n  branding: { primaryColor: '#D4AF37', companyName: 'Acme', logoUrl: '/logo.png' },\n  features: { soundNotifications: true, typingIndicator: true, readReceipts: true },\n});\n```\n\n## Pre-Chat Flow\n\n```ts\nwidget.configure({\n  socketUrl: 'https://chat.example.com',\n  channel: 'website',\n  preChatFlow: {\n    enabled: true,\n    skipToChat: true,\n    completionAction: 'chat',\n    steps: [\n      { type: 'welcome', title: 'Hi there!', subtitle: 'How can we help?', showOnlineStatus: true, starters: ['Reset password', 'Business hours', 'Billing help', 'Track order'] },\n      {\n        type: 'faq',\n        searchEnabled: true,\n        categories: [{ key: 'billing', label: 'Billing' }, { key: 'technical', label: 'Technical' }],\n        items: [\n          { question: 'How do I reset my password?', answer: 'Go to Settings > Security > Reset Password.', category: 'technical' },\n          { question: 'What payment methods do you accept?', answer: 'Visa, Mastercard, PayPal.', category: 'billing' },\n        ],\n        showChatPrompt: true,\n      },\n      {\n        type: 'guided',\n        mode: 'sequential',\n        questions: [\n          { key: 'topic', text: 'What do you need help with?', options: [\n            { value: 'billing', label: 'Billing' },\n            { value: 'technical', label: 'Technical Issue' },\n            { value: 'other', label: 'Something Else', skipToStep: 'chat' },\n          ]},\n        ],\n      },\n      { type: 'form', title: 'Quick info', fields: [\n        { key: 'name', label: 'Name', type: 'text', required: true },\n        { key: 'email', label: 'Email', type: 'email', required: true },\n      ]},\n    ],\n  },\n});\n```\n\n## FAQ-Only Mode\n\nUse the widget as a standalone help center without live chat:\n\n```ts\nwidget.configure({\n  socketUrl: 'https://chat.example.com',\n  channel: 'website',\n  features: { liveChatEnabled: false },\n  preChatFlow: {\n    enabled: true,\n    completionAction: 'close',\n    skipToChat: false,\n    steps: [\n      { type: 'welcome', title: 'Help Center' },\n      { type: 'faq', items: [...], showChatPrompt: false },\n    ],\n  },\n});\n```\n\n## Events\n\nTrack widget interactions with CustomEvents:\n\n```ts\nconst widget = document.querySelector('alx-chat-widget');\nwidget.addEventListener('chat:session-started', (e) => {\n  analytics.track('chat_started', e.detail);\n});\nwidget.addEventListener('chat:faq-viewed', (e) => {\n  analytics.track('faq_viewed', { question: e.detail.question });\n});\n```\n\n## Features\n\n- **Configurable pre-chat flow** -- Welcome screen, FAQ, guided questions, contact form, and agent selector steps in any order. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/pre-chat-flow.md)\n- **FAQ-only mode** -- Use the widget as a standalone help center without live chat. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/pre-chat-flow.md#faq-only-mode-no-live-chat)\n- **Conversation starters** -- Clickable starter chips on the welcome screen to kick off common topics. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/configuration.md#conversation-starters)\n- **Message status indicators** -- Visual sending/sent/delivered/read/failed lifecycle with retry support. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/configuration.md#message-status-indicators)\n- **Message grouping** -- iMessage-style consecutive message grouping with date separators. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/configuration.md#message-grouping)\n- **Launcher tooltip** -- Preview tooltip for unread messages when the widget is closed. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/configuration.md#launcher-preview-tooltip)\n- **Theming** -- Dark, light, and auto themes with full CSS custom property override support. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/theming.md)\n- **Offline handling** -- Configurable offline form, message, or auto-hide behavior. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/configuration.md#offline-configuration)\n- **Post-chat feedback** -- Rating or survey collection after chat ends. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/configuration.md#post-chat-configuration)\n- **Real-time events** -- CustomEvents for widget open/close, messages, sessions, FAQ interactions, escalation, and feedback. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/events.md)\n- **Public API** -- Programmatic methods for configuration, escalation, and offline control. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/api-methods.md)\n- **Branding** -- Custom primary color, company name, and logo via config. [Details](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/theming.md#branding-shortcut)\n\n## Documentation\n\n1. [Configuration](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/configuration.md) -- All config options: socket, theme, user, branding, features, offline, post-chat\n2. [Pre-Chat Flow](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/pre-chat-flow.md) -- Step types, routing logic, FAQ-only mode\n3. [Theming](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/theming.md) -- CSS custom properties reference and built-in themes\n4. [Events](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/events.md) -- CustomEvent reference with detail payloads\n5. [API Methods](https://github.com/Hariprakash1997/astralib/blob/main/packages/chat/chat-widget/docs/api-methods.md) -- Public methods: `configure()`, `escalate()`, `showOffline()`\n\n## License\n\nMIT\n","readmeFilename":"README.md"}