{"_id":"@boffin-insights/elric-chat","_rev":"2-d8d98ef39458f1d6f29735fc236cfbe5","name":"@boffin-insights/elric-chat","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@boffin-insights/elric-chat","version":"1.0.0","license":"UNLICENSED","_id":"@boffin-insights/elric-chat@1.0.0","maintainers":[{"name":"boffin-insights","email":"info@boffin.lk"}],"dist":{"shasum":"bbecc6283b59aa6e12b5c5ee56a54dfbda17c52a","tarball":"https://registry.npmjs.org/@boffin-insights/elric-chat/-/elric-chat-1.0.0.tgz","fileCount":9,"integrity":"sha512-yuxrdc9AwbeqVxDBItUETyewJOXHB87r5AAOg85qxQjdHlhckoKb2XZk5ngF2+bxQ6OjId78wMx3Xojsm1qLiQ==","signatures":[{"sig":"MEUCIFzgbAuVqr3kNRZkYyEDnMItZcKOegEl8z7guyCeQZ94AiEAscHCpgyr/ic+CL4Pqkj4oW3nFZUcE2/9Zvjh8orXZS4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":201275},"main":"./dist/index.cjs","type":"module","_from":"file:boffin-insights-elric-chat-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./styles.css":"./dist/styles.css"},"scripts":{"dev":"tsup --watch","build":"pnpm run build:js && pnpm run build:css","build:js":"tsup","build:css":"tailwindcss -i ./src/styles/elric.css -o ./dist/styles.css --minify","typecheck":"tsc --noEmit"},"_npmUser":{"name":"boffin-insights","email":"info@boffin.lk"},"_resolved":"/tmp/e9d1b63658435e7acaf5f02d8475aa1d/boffin-insights-elric-chat-1.0.0.tgz","_integrity":"sha512-yuxrdc9AwbeqVxDBItUETyewJOXHB87r5AAOg85qxQjdHlhckoKb2XZk5ngF2+bxQ6OjId78wMx3Xojsm1qLiQ==","_npmVersion":"10.8.2","description":"Embeddable Elric chat for third-party React dashboards — streaming, ECharts visualizations, and data tables identical to Boffin Foundry's Bridge UI.","directories":{},"sideEffects":["**/*.css"],"_nodeVersion":"20.20.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^6.0.146","tsup":"^8.3.0","react":"19.2.3","echarts":"^6.0.0","react-dom":"19.2.3","remark-gfm":"^4.0.1","typescript":"^5","tailwindcss":"^4","@types/react":"^19","lucide-react":"^0.577.0","@ai-sdk/react":"^3.0.160","react-markdown":"^10.1.0","@tailwindcss/cli":"^4.0.0","@types/react-dom":"^19","echarts-for-react":"^3.0.6"},"peerDependencies":{"ai":"^6.0.0","react":"^19.0.0","echarts":"^6.0.0","react-dom":"^19.0.0","remark-gfm":"^4.0.0","lucide-react":">=0.500.0","@ai-sdk/react":"^3.0.0","react-markdown":"^10.0.0","echarts-for-react":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/elric-chat_1.0.0_1780750861573_0.4015164375327194","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@boffin-insights/elric-chat","version":"1.0.1","description":"Embeddable Elric chat for third-party React dashboards — streaming, ECharts visualizations, and data tables identical to Boffin Foundry's Bridge UI.","license":"UNLICENSED","type":"module","sideEffects":["**/*.css"],"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./styles.css":"./dist/styles.css"},"scripts":{"build":"pnpm run build:js && pnpm run build:css","build:js":"tsup","build:css":"tailwindcss -i ./src/styles/elric.css -o ./dist/styles.css --minify","dev":"tsup --watch","typecheck":"tsc --noEmit"},"peerDependencies":{"@ai-sdk/react":"^3.0.0","ai":"^6.0.0","echarts":"^6.0.0","echarts-for-react":"^3.0.0","lucide-react":">=0.500.0","react":"^19.0.0","react-dom":"^19.0.0","react-markdown":"^10.0.0","remark-gfm":"^4.0.0"},"devDependencies":{"@ai-sdk/react":"^3.0.160","@tailwindcss/cli":"^4.0.0","@types/react":"^19","@types/react-dom":"^19","ai":"^6.0.146","echarts":"^6.0.0","echarts-for-react":"^3.0.6","lucide-react":"^0.577.0","react":"19.2.3","react-dom":"19.2.3","react-markdown":"^10.1.0","remark-gfm":"^4.0.1","tailwindcss":"^4","tsup":"^8.3.0","typescript":"^5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_id":"@boffin-insights/elric-chat@1.0.1","gitHead":"3441466b5e9deed69d2e287f3c2f15f31f08d282","_nodeVersion":"24.3.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-a2UwrXgYHZNTAUdNhS20MqX6LNvTvVP43jmsQdIUEH3LaSryL3OJhmIXr9j0VzBhiMq7PzFTu54gv8fcli62kQ==","shasum":"d77a2229bfdd8fd05e011257dba13c4eaa4064a6","tarball":"https://registry.npmjs.org/@boffin-insights/elric-chat/-/elric-chat-1.0.1.tgz","fileCount":9,"unpackedSize":201708,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCHcdeTrZpdl+8KawRmpSPNERxobX00eBCskEAP4kENugIgYALPNK+D1bqF4DZlI8EMepKxvXF89h8melhErhxKtK8="}]},"_npmUser":{"name":"boffin-insights","email":"info@boffin.lk"},"directories":{},"maintainers":[{"name":"boffin-insights","email":"info@boffin.lk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/elric-chat_1.0.1_1781058012823_0.9838916480475679"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-06T13:01:01.335Z","modified":"2026-06-10T02:20:13.068Z","1.0.0":"2026-06-06T13:01:01.734Z","1.0.1":"2026-06-10T02:20:12.964Z"},"license":"UNLICENSED","description":"Embeddable Elric chat for third-party React dashboards — streaming, ECharts visualizations, and data tables identical to Boffin Foundry's Bridge UI.","maintainers":[{"name":"boffin-insights","email":"info@boffin.lk"}],"readme":"# @boffin-insights/elric-chat\n\nEmbeddable Elric chat for third-party React dashboards. Renders the **exact** Boffin\nFoundry Bridge experience — streaming responses, ECharts visualizations, and the\ncollapsible raw-data inspector — backed by the public Elric product API.\n\n## Install\n\nPublished publicly on npm — just install it (no auth, no token):\n\n```bash\nnpm install @boffin-insights/elric-chat\n```\n\nPeer dependencies (your app must provide a single instance of each): `react`,\n`react-dom`, `ai`, `@ai-sdk/react`, `echarts`, `echarts-for-react`, `react-markdown`,\n`remark-gfm`, `lucide-react`.\n\n## Usage\n\n```tsx\nimport { ElricChat } from \"@boffin-insights/elric-chat\";\nimport \"@boffin-insights/elric-chat/styles.css\";\n\nexport function AnalyticsPanel() {\n  return (\n    <div style={{ height: 640 }}>\n      <ElricChat\n        apiUrl=\"https://ai.hayleys.utech-iiot.lk/api/elric/v1/chat\"\n        feedbackUrl=\"https://ai.hayleys.utech-iiot.lk/api/elric/v1/feedback\"\n        // Refresh-aware: called on every request. Your backend mints the token\n        // from the `dpp-web` Keycloak client (client-credentials) and returns it.\n        getToken={async () => {\n          const r = await fetch(\"/your-backend/elric-token\");\n          const { access_token } = await r.json();\n          return access_token;\n        }}\n        endUserId={currentUser.id}\n        theme={{ orange: \"#0a7\", chartPalette: [\"#0a7\", \"#36c\", \"#fb0\"] }}\n      />\n    </div>\n  );\n}\n```\n\n### Auth model\n\nYour **backend** authenticates to Keycloak as a confidential service client\n(`dpp-web`, client-credentials grant), mints a short-lived access token, and returns\nit to the browser. The SDK sends it as `Authorization: Bearer <token>` plus an\n`X-End-User-Id` header (metadata only). Never put the client secret in the browser.\n\n## Props\n\n| Prop | Type | Notes |\n| --- | --- | --- |\n| `apiUrl` | `string` | Public chat endpoint (`/api/elric/v1/chat`). Required. |\n| `getToken` | `() => string \\| Promise<string>` | Refresh-aware token provider. Preferred. |\n| `token` | `string` | Static token (alternative to `getToken`). |\n| `endUserId` | `string` | Your end-user id, forwarded as metadata. |\n| `feedbackUrl` | `string` | Public feedback endpoint (`/api/elric/v1/feedback`). Enables 👍/👎. |\n| `enableFeedback` | `boolean` | Defaults to true when `feedbackUrl` is set. |\n| `theme` | `Partial<ElricTheme>` | Color overrides incl. `chartPalette`. |\n| `dark` | `boolean` | Force dark mode. |\n| `placeholder` | `string` | Input placeholder. |\n| `className` | `string` | Extra root classes. |\n\n## Theming\n\nThe bundled stylesheet is scoped under `.elric-root` and reads CSS variables, so it\nwon't leak into or collide with your dashboard styles. The `theme` prop sets those\nvariables inline; `chartPalette` also recolors the ECharts series.\n","readmeFilename":"README.md"}