{"_id":"@accurix/centrinfo-widget","_rev":"5-3b73a3948aec7056372a2b4b0da97fea","name":"@accurix/centrinfo-widget","dist-tags":{"latest":"4.0.0"},"versions":{"1.0.0":{"name":"@accurix/centrinfo-widget","version":"1.0.0","keywords":["centrinfo","chat","widget","sdk"],"license":"SEE LICENSE IN LICENSE.md","_id":"@accurix/centrinfo-widget@1.0.0","maintainers":[{"name":"accurix","email":"accurixtech@gmail.com"}],"dist":{"shasum":"09ada8528db56ac18aab8a7641fe0840f73ad14c","tarball":"https://registry.npmjs.org/@accurix/centrinfo-widget/-/centrinfo-widget-1.0.0.tgz","fileCount":10,"integrity":"sha512-aTYfWSRsatJp4C0Hk84Vfdeq/kLzs8Of5H5yURAigRV+AFRmqRbx6nL6r5xBFZFeF3MhbR/a7JYdszHebjs5DQ==","signatures":[{"sig":"MEUCICmJUQc1FGoJA9ImAvBwK/TpXYgUtWykXChq2F3pc2pdAiEA4O0qZEAqy8enuYbCvz3g8O94mzio/X/3qIIdNOKmZcY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":353516},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./standalone":"./dist/cdn/centrinfo-widget.js","./package.json":"./package.json"},"gitHead":"b247a525f4d51ee9215c0d27170860d5d0ebce45","scripts":{"dev":"vite --port 3005 --host 0.0.0.0","lint":"eslint .","build":"pnpm build:npm && pnpm build:cdn","preview":"vite preview --port 3005","release":"pnpm verify:release && pnpm publish:npm && pnpm publish:cdn","test-e2e":"playwright test","build-app":"pnpm build","build:cdn":"vite build --config vite.cdn.config.ts && node scripts/write-cdn-manifest.mjs","build:npm":"tsdown --config tsdown.config.ts && node scripts/write-types-compat.mjs","test-unit":"vitest run","lint-write":"eslint . --fix","check-types":"tsc --noEmit","publish:cdn":"node scripts/publish-cdn.mjs","publish:npm":"npm publish --access public","pack:dry-run":"npm --cache /tmp/accurix-npm-cache pack --dry-run","test-coverage":"vitest run --coverage","verify:release":"pnpm check-types && pnpm lint && pnpm test-unit && pnpm build && pnpm pack:dry-run","publish:npm:provenance":"npm publish --access public --provenance"},"_npmUser":{"name":"accurix","email":"accurixtech@gmail.com"},"_npmVersion":"11.6.2","description":"Embeddable Centrinfo public chat widget — a tiny, style-isolated chat client that drops onto any website.","directories":{},"sideEffects":["./dist/cdn/centrinfo-widget.js"],"_nodeVersion":"24.12.0","dependencies":{"preact":"catalog:"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"catalog:","eslint":"catalog:","tsdown":"catalog:","vitest":"catalog:","typescript":"catalog:","@types/node":"catalog:","@playwright/test":"catalog:","@vitest/coverage-v8":"catalog:","@accurix/web-config-eslint":"workspace:^"},"_npmOperationalInternal":{"tmp":"tmp/centrinfo-widget_1.0.0_1782069865260_0.20469739326976888","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@accurix/centrinfo-widget","version":"1.0.1","keywords":["centrinfo","chat","widget","sdk"],"license":"SEE LICENSE IN LICENSE.md","_id":"@accurix/centrinfo-widget@1.0.1","maintainers":[{"name":"accurix","email":"accurixtech@gmail.com"}],"homepage":"https://github.com/accurix-tech/accurix-web#readme","bugs":{"url":"https://github.com/accurix-tech/accurix-web/issues"},"dist":{"shasum":"3a201c5b1aa62a12c727092466229a4be3aacd33","tarball":"https://registry.npmjs.org/@accurix/centrinfo-widget/-/centrinfo-widget-1.0.1.tgz","fileCount":18,"integrity":"sha512-SU4GE6Fdd0m5OcibvZYuj413ddF90/8DQ5pswhwShFk5hAORngXb4pvhwaSvk+FzUs8raP4NyrLdEYvXNdvXFA==","signatures":[{"sig":"MEQCIG8INrxgwzcjUYodU+6beHgmb2ybBJNX6nDJf0rkToZBAiAfiBEuxw4izGZR3aTAXqEOnr1YFxBq3NKd9uIDakOB9Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2357593},"main":"./dist/index.cjs","type":"module","_from":"file:accurix-centrinfo-widget-1.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./runtime":{"types":"./dist/runtime.d.ts","import":"./dist/runtime.mjs","require":"./dist/runtime.cjs"},"./standalone":"./dist/cdn/centrinfo-widget.js","./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite --port 3005 --host 0.0.0.0","lint":"eslint .","build":"pnpm build:npm && pnpm build:cdn","preview":"vite preview --port 3005","release":"pnpm verify:release && pnpm publish:npm && pnpm publish:cdn","test-e2e":"playwright test","build-app":"pnpm build","build:cdn":"vite build --config vite.cdn.config.ts && node scripts/write-cdn-manifest.mjs","build:npm":"tsdown --config tsdown.config.ts && node scripts/write-types-compat.mjs","test-unit":"vitest run","lint-write":"eslint . --fix","check-types":"tsc --noEmit","publish:cdn":"node scripts/publish-cdn.mjs","publish:npm":"npm publish --access public","pack:dry-run":"npm --cache /tmp/accurix-npm-cache pack --dry-run","test-coverage":"vitest run --coverage","verify:release":"pnpm check-types && pnpm lint && pnpm test-unit && pnpm build && pnpm pack:dry-run","publish:npm:provenance":"npm publish --access public --provenance"},"_npmUser":{"name":"accurix","email":"accurixtech@gmail.com"},"_resolved":"/tmp/369aef9d6da7b34da00401b84c67ec29/accurix-centrinfo-widget-1.0.1.tgz","_integrity":"sha512-SU4GE6Fdd0m5OcibvZYuj413ddF90/8DQ5pswhwShFk5hAORngXb4pvhwaSvk+FzUs8raP4NyrLdEYvXNdvXFA==","repository":{"url":"git+https://github.com/accurix-tech/accurix-web.git","type":"git","directory":"sdk/centrinfo-widget"},"_npmVersion":"11.6.2","description":"Embeddable Centrinfo public chat widget — a tiny, style-isolated chat client that drops onto any website.","directories":{},"sideEffects":["./dist/cdn/centrinfo-widget.js"],"_nodeVersion":"24.12.0","dependencies":{"preact":"^10.27.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.0.0","jsdom":"^26.0.0","eslint":"^9.27.0","tsdown":"^0.18.0","vitest":"^3.2.0","typescript":"^5.8.0","@types/node":"^22.0.0","@playwright/test":"^1.50.0","@vitest/coverage-v8":"^3.2.0","@accurix/centrinfo-results":"^0.1.0","@accurix/web-config-eslint":"^0.0.0"},"peerDependencies":{"@accurix/centrinfo":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/centrinfo-widget_1.0.1_1784679673098_0.4774645772306807","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@accurix/centrinfo-widget","version":"1.1.0","keywords":["centrinfo","chat","widget","sdk"],"license":"SEE LICENSE IN LICENSE.md","_id":"@accurix/centrinfo-widget@1.1.0","maintainers":[{"name":"accurix","email":"accurixtech@gmail.com"}],"homepage":"https://github.com/accurix-tech/accurix-web#readme","bugs":{"url":"https://github.com/accurix-tech/accurix-web/issues"},"dist":{"shasum":"73f22814dec22f35d67331d4014857cb318d16c9","tarball":"https://registry.npmjs.org/@accurix/centrinfo-widget/-/centrinfo-widget-1.1.0.tgz","fileCount":18,"integrity":"sha512-aESFuGjP/voT64wcKSGBP8yYvTgXwlATlqL4tCMWmPTM0+zlYjRNhfCVuVsPnwDHrdBrmBtoN9tAHRB4ZiPw4A==","signatures":[{"sig":"MEYCIQCuXTVKw3ZRbmdxHu5J7+VNYBsnojBjJQZwGwxo++yK0AIhANa2ZJggF0Iqi6EpnxpewB/C6pwjT5jVsWIb5HotM/xv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2412147},"main":"./dist/index.cjs","type":"module","_from":"file:accurix-centrinfo-widget-1.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./runtime":{"types":"./dist/runtime.d.ts","import":"./dist/runtime.mjs","require":"./dist/runtime.cjs"},"./standalone":"./dist/cdn/centrinfo-widget.js","./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite --port 3005 --host 0.0.0.0","lint":"eslint .","build":"pnpm build:npm && pnpm build:cdn","preview":"vite preview --port 3005","release":"pnpm verify:release && pnpm publish:npm && pnpm publish:cdn","test-e2e":"playwright test","build-app":"pnpm build","build:cdn":"vite build --config vite.cdn.config.ts && node scripts/write-cdn-manifest.mjs","build:npm":"tsdown --config tsdown.config.ts && node scripts/write-types-compat.mjs","test-unit":"vitest run","lint-write":"eslint . --fix","check-types":"tsc --noEmit","publish:cdn":"node scripts/publish-cdn.mjs","publish:npm":"npm publish --access public","pack:dry-run":"npm --cache /tmp/accurix-npm-cache pack --dry-run","test-coverage":"vitest run --coverage","verify:release":"pnpm check-types && pnpm lint && pnpm test-unit && pnpm build && pnpm pack:dry-run","publish:npm:provenance":"npm publish --access public --provenance"},"_npmUser":{"name":"accurix","email":"accurixtech@gmail.com"},"_resolved":"/tmp/0849124e968dba78a5d2cafb4a6385d8/accurix-centrinfo-widget-1.1.0.tgz","_integrity":"sha512-aESFuGjP/voT64wcKSGBP8yYvTgXwlATlqL4tCMWmPTM0+zlYjRNhfCVuVsPnwDHrdBrmBtoN9tAHRB4ZiPw4A==","repository":{"url":"git+https://github.com/accurix-tech/accurix-web.git","type":"git","directory":"sdk/centrinfo-widget"},"_npmVersion":"11.6.2","description":"Embeddable Centrinfo public chat widget — a tiny, style-isolated chat client that drops onto any website.","directories":{},"sideEffects":["./dist/cdn/centrinfo-widget.js"],"_nodeVersion":"24.12.0","dependencies":{"preact":"^10.27.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.0.0","jsdom":"^26.0.0","eslint":"^9.27.0","tsdown":"^0.18.0","vitest":"^3.2.0","wrangler":"^4.91.0","typescript":"^5.8.0","@types/node":"^22.0.0","@playwright/test":"^1.50.0","@vitest/coverage-v8":"^3.2.0","@accurix/centrinfo-results":"^0.1.0","@accurix/web-config-eslint":"^0.0.0"},"peerDependencies":{"@accurix/centrinfo":"^0.1.2"},"_npmOperationalInternal":{"tmp":"tmp/centrinfo-widget_1.1.0_1786234696716_0.8414147165443748","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@accurix/centrinfo-widget","version":"2.0.0","keywords":["centrinfo","chat","widget","sdk"],"license":"SEE LICENSE IN LICENSE.md","_id":"@accurix/centrinfo-widget@2.0.0","maintainers":[{"name":"accurix","email":"accurixtech@gmail.com"}],"homepage":"https://github.com/accurix-tech/accurix-web#readme","bugs":{"url":"https://github.com/accurix-tech/accurix-web/issues"},"dist":{"shasum":"becc452f56aaf2e8d7da53ca564ce71bd2fb6cb6","tarball":"https://registry.npmjs.org/@accurix/centrinfo-widget/-/centrinfo-widget-2.0.0.tgz","fileCount":18,"integrity":"sha512-QlvmlbVl79d9zF7jd40Xto/cwiyMOqZvDugLNT1C34kIvUu5HAZSOB2w7cUjYaNZdhZgWxtRfuXuuVSjdSDSBg==","signatures":[{"sig":"MEYCIQCJ0rD0twySpLBdTbXYlOH+Sqa+BjAyMhihvy3f+7N8JQIhAOKLIkBJRwVFKOw0Ke3NPVgZIivlOlyHpIHbmdVs/ZHe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2515850},"main":"./dist/index.cjs","type":"module","_from":"file:accurix-centrinfo-widget-2.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./runtime":{"types":"./dist/runtime.d.ts","import":"./dist/runtime.mjs","require":"./dist/runtime.cjs"},"./standalone":"./dist/cdn/centrinfo-widget.js","./package.json":"./package.json"},"private":false,"scripts":{"dev":"vite --port 3005 --host 0.0.0.0","lint":"eslint .","build":"pnpm build:npm && pnpm build:cdn","preview":"vite preview --port 3005","release":"pnpm verify:release && pnpm publish:npm && pnpm publish:cdn","test-e2e":"playwright test","build-app":"pnpm build","build:cdn":"vite build --config vite.cdn.config.ts && node scripts/write-cdn-manifest.mjs","build:npm":"tsdown --config tsdown.config.ts && node scripts/write-types-compat.mjs","test-unit":"vitest run","lint-write":"eslint . --fix","check-types":"tsc --noEmit","publish:cdn":"node scripts/publish-cdn.mjs","publish:npm":"npm publish --access public","pack:dry-run":"npm --cache /tmp/accurix-npm-cache pack --dry-run","test-coverage":"vitest run --coverage","verify:release":"pnpm check-types && pnpm lint && pnpm test-unit && pnpm build && pnpm pack:dry-run","publish:npm:provenance":"npm publish --access public --provenance"},"_npmUser":{"name":"accurix","email":"accurixtech@gmail.com"},"_resolved":"/tmp/dec3516e7e9f8dd8f12221387ed2abb8/accurix-centrinfo-widget-2.0.0.tgz","_integrity":"sha512-QlvmlbVl79d9zF7jd40Xto/cwiyMOqZvDugLNT1C34kIvUu5HAZSOB2w7cUjYaNZdhZgWxtRfuXuuVSjdSDSBg==","repository":{"url":"git+https://github.com/accurix-tech/accurix-web.git","type":"git","directory":"sdk/centrinfo-widget"},"_npmVersion":"11.6.2","description":"Embeddable Centrinfo public chat widget — a tiny, style-isolated chat client that drops onto any website.","directories":{},"sideEffects":["./dist/cdn/centrinfo-widget.js"],"_nodeVersion":"24.12.0","dependencies":{"preact":"^10.27.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.0.0","jsdom":"^26.0.0","eslint":"^9.27.0","tsdown":"^0.18.0","vitest":"^3.2.0","wrangler":"^4.91.0","typescript":"^5.8.0","@types/node":"^22.0.0","@playwright/test":"^1.50.0","@vitest/coverage-v8":"^3.2.0","@accurix/centrinfo-results":"^0.1.0","@accurix/web-config-eslint":"^0.0.0"},"peerDependencies":{"@accurix/centrinfo":"^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/centrinfo-widget_2.0.0_1788306183693_0.6067606994448698","host":"s3://npm-registry-packages-npm-production"}},"4.0.0":{"name":"@accurix/centrinfo-widget","version":"4.0.0","private":false,"type":"module","sideEffects":["./dist/cdn/centrinfo-widget.js"],"main":"./dist/index.cjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./runtime":{"types":"./dist/runtime.d.ts","import":"./dist/runtime.mjs","require":"./dist/runtime.cjs"},"./standalone":"./dist/cdn/centrinfo-widget.js","./package.json":"./package.json"},"description":"Embeddable Centrinfo public chat widget — a tiny, style-isolated chat client that drops onto any website.","keywords":["centrinfo","chat","widget","sdk"],"license":"SEE LICENSE IN LICENSE.md","repository":{"type":"git","url":"git+https://github.com/accurix-tech/accurix-web.git","directory":"sdk/centrinfo-widget"},"dependencies":{"preact":"^10.27.0"},"devDependencies":{"@playwright/test":"^1.50.0","@types/node":"^22.0.0","@vitest/coverage-v8":"^3.2.0","eslint":"^9.27.0","jsdom":"^26.0.0","tsdown":"^0.18.0","typescript":"^5.8.0","vite":"^7.0.0","vitest":"^3.2.0","wrangler":"^4.91.0","@accurix/web-config-eslint":"^0.0.0","@accurix/centrinfo-results":"^0.1.0"},"module":"./dist/index.mjs","peerDependencies":{"@accurix/centrinfo":"^0.4.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"build":"pnpm build:npm && pnpm build:cdn","build-app":"pnpm build","build:cdn":"vite build --config vite.cdn.config.ts && node scripts/write-cdn-manifest.mjs","build:npm":"tsdown --config tsdown.config.ts && node scripts/write-types-compat.mjs","check-types":"tsc --noEmit","dev":"vite --port 3005 --host 0.0.0.0","lint":"eslint .","lint-write":"eslint . --fix","pack:dry-run":"npm --cache /tmp/accurix-npm-cache pack --dry-run","preview":"vite preview --port 3005","publish:cdn":"node scripts/publish-cdn.mjs","publish:npm":"npm publish --access public","publish:npm:provenance":"npm publish --access public --provenance","release":"pnpm verify:release && pnpm publish:npm && pnpm publish:cdn","test-coverage":"vitest run --coverage","test-e2e":"playwright test","test-unit":"vitest run","verify:release":"pnpm check-types && pnpm lint && pnpm test-unit && pnpm build && pnpm pack:dry-run"},"_id":"@accurix/centrinfo-widget@4.0.0","bugs":{"url":"https://github.com/accurix-tech/accurix-web/issues"},"homepage":"https://github.com/accurix-tech/accurix-web#readme","_integrity":"sha512-HjocCSIh0NIIaKdTeRcjZIZlenB9iQDBaPR26THC3JN0ZQMpcU4ce9L9ZQ5BlF3vMaCdA4Tv9/nfHl8mZnEWbA==","_resolved":"/tmp/a23fe6cca998ccea25655950940722fb/accurix-centrinfo-widget-4.0.0.tgz","_from":"file:accurix-centrinfo-widget-4.0.0.tgz","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-HjocCSIh0NIIaKdTeRcjZIZlenB9iQDBaPR26THC3JN0ZQMpcU4ce9L9ZQ5BlF3vMaCdA4Tv9/nfHl8mZnEWbA==","shasum":"87f8a6b82969c5ae05ddbcb8b7f4fd6d8f98d964","tarball":"https://registry.npmjs.org/@accurix/centrinfo-widget/-/centrinfo-widget-4.0.0.tgz","fileCount":18,"unpackedSize":2515850,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDOMXLh0fdfGNpQb0jzPANuiQtr8upPkZOeh6t3/QtDygIhAL6Hm7HRkmrxs5Mcnxseg/x5tddXbebnSYlSRqQcACvR"}]},"_npmUser":{"name":"accurix","email":"accurixtech@gmail.com"},"directories":{},"maintainers":[{"name":"accurix","email":"accurixtech@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/centrinfo-widget_4.0.0_1788454547290_0.4339087145090179"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-21T19:24:25.158Z","modified":"2026-09-03T16:55:47.629Z","1.0.0":"2026-06-21T19:24:25.413Z","1.0.1":"2026-07-22T00:21:13.495Z","1.1.0":"2026-08-09T00:18:16.865Z","2.0.0":"2026-09-01T23:43:03.845Z","4.0.0":"2026-09-03T16:55:47.472Z"},"bugs":{"url":"https://github.com/accurix-tech/accurix-web/issues"},"license":"SEE LICENSE IN LICENSE.md","homepage":"https://github.com/accurix-tech/accurix-web#readme","keywords":["centrinfo","chat","widget","sdk"],"repository":{"type":"git","url":"git+https://github.com/accurix-tech/accurix-web.git","directory":"sdk/centrinfo-widget"},"description":"Embeddable Centrinfo public chat widget — a tiny, style-isolated chat client that drops onto any website.","maintainers":[{"name":"accurix","email":"accurixtech@gmail.com"}],"readme":"# @accurix/centrinfo-widget\n\nThe embeddable **Centrinfo public chat widget** — a style-isolated chat client\nthat drops onto any website and can dock bottom-right or bottom-left.\n\nBuilt with Preact inside a **Shadow DOM** web component, so it can't break the\nhost site's CSS and the host's CSS can't break it. It talks to the Centrinfo\npublic chat API (see [`.claude/PUBLIC_CHAT.md`](../../../../.claude/PUBLIC_CHAT.md)\nfor the backend, and [`.claude/PUBLIC_WIDGET_LIBRARY.md`](../../../../.claude/PUBLIC_WIDGET_LIBRARY.md)\nfor the design).\n\n## Install\n\n### Script tag (any site — WordPress / Webflow / plain HTML)\n\nZero-JS, via `data-*` on the script:\n\n```html\n<script\n  src=\"https://cdn.accurixtech.com/centrinfo/js/sdk-centrinfo-widget-v1.0.0/centrinfo-widget.js\"\n  data-token=\"pub_8f3k…\"\n  defer\n></script>\n```\n\nOr call `init` yourself:\n\n```html\n<script\n  src=\"https://cdn.accurixtech.com/centrinfo/js/sdk-centrinfo-widget-v1.0.0/centrinfo-widget.js\"\n  defer\n></script>\n<script>\n  window.addEventListener('load', () => Centrinfo.init({ token: 'pub_8f3k…' }));\n</script>\n```\n\n### npm (React / Next / any bundler)\n\n```bash\npnpm add @accurix/centrinfo-widget\n```\n\n```ts\nimport { init } from '@accurix/centrinfo-widget';\nconst widget = init({ token: 'pub_8f3k…' });\n// widget.open() / .close() / .toggle() / .destroy()\n```\n\n## Config\n\n| Option                                                        | Type                          | Default     | Notes                                                                                                                               |\n| ------------------------------------------------------------- | ----------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |\n| `token` **(required)**                                        | string                        | —           | The org's `pub_*` token. It _is_ the org identity.                                                                                  |\n| `analyticsContextToken`                                       | string                        | —           | Server-signed governed analytics context. It must expire within 15 minutes and be scoped to this public widget token.               |\n| `identityToken`                                               | string                        | —           | Short-lived customer identity JWT. Authenticated history is scoped to its verified external user ID.                                |\n| `getIdentityToken`                                            | function                      | —           | Returns a fresh customer identity JWT before authenticated requests. Prefer this for expiring tokens.                               |\n| `apiBaseUrl`                                                  | string                        | prod API    | Override for staging / self-host.                                                                                                   |\n| `accentColor`                                                 | string                        | brand green | Any CSS color — drives the launcher, header, user bubbles & send button (a darker shade for the gradient is derived automatically). |\n| `themeTokens`                                                 | object                        | —           | Enterprise theme tokens for chat surfaces: accent, background, surface, text, muted text, border, shadow, radius, and font family.  |\n| `launcherIcon`                                                | string                        | chat glyph  | Image URL (e.g. the org's logo) shown in the launcher bubble.                                                                       |\n| `theme`                                                       | `'light' \\| 'dark' \\| 'auto'` | `'auto'`    | `auto` follows the host's `prefers-color-scheme`; `light`/`dark` force it.                                                          |\n| `openByDefault`                                               | boolean                       | `false`     | Open the panel on load.                                                                                                             |\n| `zIndex`                                                      | number                        | very high   | Stacking against the host page.                                                                                                     |\n| `demo`                                                        | boolean                       | `false`     | Use the built-in mock transport — **no backend/token needed**.                                                                      |\n| `configRefreshSeconds`                                        | number                        | `30`        | While the panel is open, refresh token branding/actions from `bootstrap`; set `0` to disable.                                       |\n| `onOpen` / `onClose` / `onMessage` / `onAction` / `onHandoff` | function                      | —           | Event hooks.                                                                                                                        |\n\n```ts\ninit({\n  token: 'pub_8f3k...',\n  themeTokens: {\n    accent: '#176b45',\n    accentStrong: '#0f5134',\n    background: '#f8fafc',\n    surface: '#ffffff',\n    surfaceMuted: '#f1f5f9',\n    text: '#0f172a',\n    mutedText: '#64748b',\n    border: '#cbd5e1',\n    radius: '10px',\n    fontFamily: 'Inter, system-ui, sans-serif',\n  },\n});\n```\n\nPersona (agent name/avatar/greeting), the voice toggle, and which lead-gen\nactions appear all come from the token via `GET /public-chat/bootstrap` — not\nfrom the snippet. Open widgets refresh that bootstrap data every 30 seconds, so\nsaved dashboard settings reach visitors without a page reload.\n\n## Authenticated history\n\nFor a logged-in customer, mint a short-lived identity token on the host\nbackend and supply `getIdentityToken`. Keep the signing private key on the\nserver, and use a stable external user ID for that customer.\n\n```ts\nconst widget = init({\n  token: 'pub_8f3k...',\n  getIdentityToken: async () => {\n    const response = await fetch('/api/centrinfo/token', {\n      credentials: 'include',\n    });\n    if (!response.ok) throw new Error('Sign in is required.');\n    return response.json();\n  },\n});\n```\n\nAuthenticated conversations are restored from Centrinfo's backend in a new\nbrowser or device after the identity token is verified. Anonymous history is\nstored only according to the widget's `persistence` option and cannot be\nloaded through authenticated history.\n\nCall `widget.shutdown()` on host-app logout when the page may be shared. It\nremoves the local transcript and resets the mounted widget to an anonymous\nsession. Retained server history is not deleted and returns only when the same\nverified customer signs in again.\n\nWhen business data chat is enabled for a widget token, responses follow a\nvisitor-safe presentation contract:\n\n- a normal knowledge, RAG, or web-search answer remains text;\n- a single live value may add a KPI and a comparison or timeline may add an\n  expandable chart;\n- charts with more than two points include Zoom out, Reset, and Zoom in\n  controls with an exact visible-range announcement; the controls do not take\n  over browser zoom or page scrolling;\n- result tables and their row values are never rendered in the public widget;\n  the written answer remains available instead;\n- charts include a visible text summary, contained tap/hover details, and an\n  accessible expanded view that restores the conversation when closed.\n\nFor customer-specific analytics, create the signed context on the host\napplication's server and pass only the resulting short-lived token as\n`analyticsContextToken`. Values such as `userId`, `businessId`, or `tenantId`\nmust be checked by the published data model before they are applied.\n\nThe signed token payload must contain issued-at and expiry times, an expiry no\nmore than 15 minutes after issue, the widget-specific audience, and the\ngoverned context:\n\n```json\n{\n  \"iat\": 1784304000,\n  \"exp\": 1784304900,\n  \"aud\": \"centrinfo-public-chat:<widget-token-id>\",\n  \"context\": {\n    \"userId\": \"customer-user-id\",\n    \"businessId\": \"customer-business-id\"\n  }\n}\n```\n\nReplace `<widget-token-id>` with the backend-issued ID associated with the\nmatching public widget token. Sign this payload only on the host application's\nserver; never expose the signing secret or mint analytics context tokens in\nbrowser code.\n\n`data-*` attributes for the script install: `data-token`, `data-api-base`,\n`data-accent`, `data-theme`, `data-open`, `data-demo`,\n`data-config-refresh`.\n\n## Environment\n\nThe default API origin is baked from `VITE_API_BASE_URL` (see `.env.example`).\nCopy `.env.example` → `.env` (gitignored) to override locally; when it is unset,\nthe package uses the managed production service. A per-`init` `apiBaseUrl`\noverrides it for development, staging, dedicated-cloud, private-cloud, or\non-premises environments. Restart the dev server after editing `.env`.\n\n## Develop\n\n```bash\npnpm --filter @accurix/centrinfo-widget dev      # playground host site @ :3005\npnpm --filter @accurix/centrinfo-widget build    # → dist/index.{mjs,cjs,d.ts} + dist/cdn/*\npnpm --filter @accurix/centrinfo-widget check-types\npnpm --filter @accurix/centrinfo-widget test-unit\npnpm --filter @accurix/centrinfo-widget verify:release\n```\n\n### Test analytics without a backend\n\nOpen `http://localhost:3005/?demo`, open the widget, and use any of these starter prompts:\n\n- `Show a demo chart` — renders an expandable three-line order-status chart.\n- `Show a demo KPI` — renders an active-accounts KPI.\n- `Test the hidden table response` — confirms that the explanation appears but public table rows do not enter the DOM.\n\nRemove `?demo` to test the real public-chat API and the organization’s published analytics configuration.\n\n## Release Artifacts\n\n`build:npm` uses tsdown to emit the npm package entrypoints:\n\n- `dist/index.mjs`\n- `dist/index.cjs`\n- `dist/index.d.ts`\n\n`build:cdn` uses Vite to emit the browser script and then writes a manifest:\n\n- `dist/cdn/centrinfo-widget.js`\n- `dist/cdn/manifest.json`\n\nCanonical v1 CDN URL:\n\n```text\nhttps://cdn.accurixtech.com/centrinfo/js/sdk-centrinfo-widget-v1.0.0/centrinfo-widget.js\n```\n\n## Status\n\nv1 in progress — chat, streaming (SSE), citations, suggested-reply chips,\nsession memory, handoff CTA, lead-gen actions, voice input, theming.\nBackend `GET /public-chat/bootstrap` is pending (the only backend work);\nthe client falls back to sensible defaults until it lands.\n","readmeFilename":"README.md"}