{"_id":"@blunx/web-sdk","_rev":"3-7e360a2c6476bff7716c7a971a804f33","name":"@blunx/web-sdk","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.1":{"name":"@blunx/web-sdk","version":"0.1.1","keywords":["blunx","bi","business-intelligence","dashboard","cockpit","chat","ai","sdk","widget"],"author":{"name":"Amir BOUSSARI Olouwa cheoun","email":"awillosse@gmail.com"},"license":"MIT","_id":"@blunx/web-sdk@0.1.1","maintainers":[{"name":"amirbsr","email":"awillosse@gmail.com"}],"homepage":"https://github.com/5amir/blunx-web-sdk#readme","bugs":{"url":"https://github.com/5amir/blunx-web-sdk/issues","email":"support@blunx.com"},"dist":{"shasum":"e0c59c4284cce44bdc70aa971fb33536620d45c4","tarball":"https://registry.npmjs.org/@blunx/web-sdk/-/web-sdk-0.1.1.tgz","fileCount":8,"integrity":"sha512-o7N1eSJNzKeoWOpOSz1jFRPPopjvExZ2QMNmUQck3k+KSxXczMpTbZiK03VjWvXgZtggPMP9wrJotzQgE7Jc2w==","signatures":[{"sig":"MEYCIQD8FCGs/Qsx55KvoYw71yB/JX3Jqz2TygOGLamxGXaVxQIhAN+tkKoNIfZZQgzFJax8KauU3aTzZ9ghS2A/bl56oW9g","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1364787},"main":"dist/blunx.esm.js","type":"module","types":"dist/index.d.ts","unpkg":"dist/blunx.min.js","module":"dist/blunx.esm.js","browser":"dist/blunx.min.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/blunx.esm.js","default":"./dist/blunx.esm.js"},"./dist/*":"./dist/*","./loader":"./dist/blunx-loader.min.js","./package.json":"./package.json"},"gitHead":"6f8bb656be1fede8d7efced296f0cb03da8ae3fb","private":false,"scripts":{"demo":"php -S 127.0.0.1:8090 -t . test/demo/router.php","test":"vitest run","build":"node scripts/scope-css.mjs && node esbuild.config.mjs","watch":"node scripts/scope-css.mjs && node esbuild.config.mjs --watch","demo:all":"node test/demo/run-all.mjs","test:watch":"vitest","demo:install":"node test/demo/install-demos.mjs","prepublishOnly":"npm run build","demo:all:no-open":"node test/demo/run-all.mjs --no-open"},"_npmUser":{"name":"amirbsr","email":"awillosse@gmail.com"},"jsdelivr":"dist/blunx.min.js","repository":{"url":"git+https://github.com/5amir/blunx-web-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Blunx AI — Web SDK autonome et agnostique : cockpit BI + dashboards, intégrable dans n'importe quel front-end (HTML pur, Laravel, React, Vue, Angular...).","directories":{},"sideEffects":true,"_nodeVersion":"22.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^25.0.1","vitest":"^4.1.11","esbuild":"^0.24.0","postcss":"^8.5.26"},"_npmOperationalInternal":{"tmp":"tmp/web-sdk_0.1.1_1787302715224_0.15744084639014666","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@blunx/web-sdk","version":"0.1.2","keywords":["blunx","bi","business-intelligence","dashboard","cockpit","chat","ai","sdk","widget"],"author":{"name":"Amir BOUSSARI Olouwa cheoun","email":"awillosse@gmail.com"},"license":"MIT","_id":"@blunx/web-sdk@0.1.2","maintainers":[{"name":"amirbsr","email":"awillosse@gmail.com"}],"homepage":"https://github.com/5amir/blunx-web-sdk#readme","bugs":{"url":"https://github.com/5amir/blunx-web-sdk/issues","email":"support@blunx.com"},"dist":{"shasum":"1771799fab2bf4d5894b48ced2fedf15313fdcf0","tarball":"https://registry.npmjs.org/@blunx/web-sdk/-/web-sdk-0.1.2.tgz","fileCount":8,"integrity":"sha512-SVRcufX18s4gVfbcwTatAX0aornhqck88cuotAdPF1ZvPZxE4b7o68o35pDB9XM/2Gd/mLyhzkSENVqExGTj9w==","signatures":[{"sig":"MEUCIQC2lINMmv/Vbo8zVUusSF5cUISLCAr0Lp7fek6A1uM9XwIgSHU9C7y/MR0f2y1EIFXgbTdnyZMhH58X7s8YUYbRF10=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1363640},"main":"dist/blunx.esm.js","type":"module","types":"dist/index.d.ts","unpkg":"dist/blunx.min.js","module":"dist/blunx.esm.js","browser":"dist/blunx.min.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/blunx.esm.js","default":"./dist/blunx.esm.js"},"./dist/*":"./dist/*","./loader":"./dist/blunx-loader.min.js","./package.json":"./package.json"},"gitHead":"dad8fea13f67bb5c9d6e2323d1178ef59e8738e3","private":false,"scripts":{"demo":"php -S 127.0.0.1:8090 -t . test/demo/router.php","test":"vitest run","build":"node scripts/scope-css.mjs && node esbuild.config.mjs","watch":"node scripts/scope-css.mjs && node esbuild.config.mjs --watch","demo:all":"node test/demo/run-all.mjs","test:watch":"vitest","demo:install":"node test/demo/install-demos.mjs","prepublishOnly":"npm run build","demo:all:no-open":"node test/demo/run-all.mjs --no-open"},"_npmUser":{"name":"amirbsr","email":"awillosse@gmail.com"},"jsdelivr":"dist/blunx.min.js","repository":{"url":"git+https://github.com/5amir/blunx-web-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Blunx AI — standalone, framework-agnostic web SDK: embeddable BI cockpit and dashboards for any front-end (plain HTML, Laravel, React, Vue, Angular...).","directories":{},"sideEffects":true,"_nodeVersion":"22.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^25.0.1","vitest":"^4.1.11","esbuild":"^0.24.0","postcss":"^8.5.26"},"_npmOperationalInternal":{"tmp":"tmp/web-sdk_0.1.2_1787397222936_0.254560274332168","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@blunx/web-sdk","version":"0.1.3","description":"Blunx AI — standalone, framework-agnostic web SDK: embeddable BI cockpit and dashboards for any front-end (plain HTML, Laravel, React, Vue, Angular...).","keywords":["blunx","bi","business-intelligence","dashboard","cockpit","chat","ai","sdk","widget"],"private":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/5amir/blunx-web-sdk.git"},"homepage":"https://github.com/5amir/blunx-web-sdk#readme","bugs":{"url":"https://github.com/5amir/blunx-web-sdk/issues","email":"support@blunx.com"},"license":"MIT","author":{"name":"Amir BOUSSARI Olouwa cheoun","email":"awillosse@gmail.com"},"type":"module","main":"dist/blunx.esm.js","module":"dist/blunx.esm.js","types":"dist/index.d.ts","browser":"dist/blunx.min.js","unpkg":"dist/blunx.min.js","jsdelivr":"dist/blunx.min.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/blunx.esm.js","default":"./dist/blunx.esm.js"},"./loader":"./dist/blunx-loader.min.js","./dist/*":"./dist/*","./package.json":"./package.json"},"sideEffects":true,"scripts":{"build":"node scripts/scope-css.mjs && node esbuild.config.mjs","watch":"node scripts/scope-css.mjs && node esbuild.config.mjs --watch","test":"vitest run","test:watch":"vitest","demo":"php -S 127.0.0.1:8090 -t . test/demo/router.php","demo:install":"node test/demo/install-demos.mjs","demo:all":"node test/demo/run-all.mjs","demo:all:no-open":"node test/demo/run-all.mjs --no-open","prepublishOnly":"npm run build"},"devDependencies":{"esbuild":"^0.24.0","jsdom":"^25.0.1","postcss":"^8.5.26","vitest":"^4.1.11"},"_id":"@blunx/web-sdk@0.1.3","gitHead":"1fb11218b37d8a1020d79cb700e8296509967301","_nodeVersion":"22.7.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-SxOr9ACJNbRBXnKmAgDJdeTaDbR1kG/pEeRqXj6auAieXz8IvF9J9QM+MqEvk9TjIknvbWst9ZDaKwl/6pIk+w==","shasum":"934ae0acf309be8be99f913a425c23ffc04e1012","tarball":"https://registry.npmjs.org/@blunx/web-sdk/-/web-sdk-0.1.3.tgz","fileCount":8,"unpackedSize":1375771,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID9mxV1prA8rmseCz8avsdFFvMqDDKp0V+6GJavMccr4AiA+glCdhV5UYDxjrbYlzKIQaa5lv/rZ75tqzkRpVYc9Lg=="}]},"_npmUser":{"name":"amirbsr","email":"awillosse@gmail.com"},"directories":{},"maintainers":[{"name":"amirbsr","email":"awillosse@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/web-sdk_0.1.3_1788886474501_0.9448193679781107"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-21T08:58:35.078Z","modified":"2026-09-08T16:54:35.121Z","0.1.1":"2026-08-21T08:58:35.371Z","0.1.2":"2026-08-22T11:13:43.083Z","0.1.3":"2026-09-08T16:54:34.631Z"},"bugs":{"url":"https://github.com/5amir/blunx-web-sdk/issues","email":"support@blunx.com"},"author":{"name":"Amir BOUSSARI Olouwa cheoun","email":"awillosse@gmail.com"},"license":"MIT","homepage":"https://github.com/5amir/blunx-web-sdk#readme","keywords":["blunx","bi","business-intelligence","dashboard","cockpit","chat","ai","sdk","widget"],"repository":{"type":"git","url":"git+https://github.com/5amir/blunx-web-sdk.git"},"description":"Blunx AI — standalone, framework-agnostic web SDK: embeddable BI cockpit and dashboards for any front-end (plain HTML, Laravel, React, Vue, Angular...).","maintainers":[{"name":"amirbsr","email":"awillosse@gmail.com"}],"readme":"# @blunx/web-sdk\r\n\r\n![npm version](https://img.shields.io/npm/v/@blunx/web-sdk) ![License](https://img.shields.io/badge/license-MIT-blue.svg) ![npm downloads](https://img.shields.io/npm/dm/@blunx/web-sdk) ![jsDelivr](https://img.shields.io/jsdelivr/npm/hm/@blunx/web-sdk)\r\n\r\n**Embeddable BI cockpit and dashboards** — a standalone, framework-agnostic\r\nweb SDK that works in any front-end (plain HTML, Laravel, React, Vue,\r\nAngular, Svelte…). One codebase, automatically updated via CDN.\r\n\r\n> [!IMPORTANT]\r\n> The SDK handles rendering and client-side interaction. Authentication, SQL\r\n> execution and persistence are provided by a backend that exposes the\r\n> [API contract](#api-contract) `/api/blunx/*`.\r\n\r\n## Table of contents\r\n\r\n- [Features](#features)\r\n- [Installation](#installation)\r\n- [Quick start](#quick-start)\r\n- [Configuration](#configuration)\r\n- [Views & navigation](#views--navigation)\r\n- [Integrations](#integrations)\r\n- [CSS isolation](#css-isolation)\r\n- [API contract](#api-contract)\r\n- [Development](#development)\r\n- [Contributing](#contributing)\r\n- [Security](#security)\r\n- [Code of conduct](#code-of-conduct)\r\n- [License](#license)\r\n\r\n## Features\r\n\r\n- **BI cockpit**: AI chat + visualization canvas (ECharts charts, DataTables\r\n  tables) + dashboard management.\r\n- **Dashboards**: widgets (charts, tables) and insights.\r\n- **Framework-agnostic**: `<script>` or npm, no imposed bundler.\r\n- **Client-side routing**: hash-based navigation (`#/dashboard/{uuid}`), no\r\n  server rendering routes required.\r\n- **Self-contained**: CSS, logo and translations inlined in the bundle;\r\n  third-party dependencies (jQuery, Bootstrap, DataTables, ECharts…) are\r\n  injected from pinned CDNs if absent from the host page.\r\n- **CSS isolation**: all styles are pre-scoped under `.blunx-root`.\r\n- **i18n**: French / English embedded.\r\n\r\n## Installation\r\n\r\n### Script tag (plain HTML, Laravel/Blade, PHP…)\r\n\r\n```html\r\n<div id=\"blunx\"></div>\r\n<script src=\"https://cdn.jsdelivr.net/npm/@blunx/web-sdk/dist/blunx-loader.min.js\"\r\n        data-container=\"#blunx\"\r\n        data-api-base-url=\"\"\r\n        data-locale=\"fr\"></script>\r\n```\r\n\r\nThe **loader** is auto-update: it always points to the latest published\r\nversion — no manual updates.\r\n\r\n### npm (React, Vue, Angular, Svelte, Vite…)\r\n\r\n```bash\r\nnpm install @blunx/web-sdk\r\n```\r\n\r\n## Quick start\r\n\r\n```js\r\nimport { init, destroy } from '@blunx/web-sdk';\r\n\r\n// On component mount\r\nawait init({ container: '#blunx', apiBaseUrl: '/api/blunx' });\r\n\r\n// On component unmount\r\ndestroy();\r\n```\r\n\r\nThe SDK mounts into the provided DOM container; the public API is\r\n`init()`, `destroy()`, `navigate()` and `version` (TypeScript types included,\r\n`dist/index.d.ts`).\r\n\r\n## Configuration\r\n\r\n| Option | Type | Default | Description |\r\n|---|---|---|---|\r\n| `container` | `string \\| HTMLElement` | `'#blunx'` | Selector / element to mount into |\r\n| `apiBaseUrl` | `string` | `''` | Backend API base (empty = same origin) |\r\n| `locale` | `'fr' \\| 'en'` | `'fr'` | Default language |\r\n| `view` | `'auto' \\| 'cockpit' \\| 'dashboard'` | `'auto'` | Initial view |\r\n| `dashboardUuid` | `string` | `null` | Dashboard UUID when `view: 'dashboard'` |\r\n| `onReady` | `function` | `null` | Called after first mount `(info) => {}` |\r\n| `onError` | `function` | `null` | Called on error `(error) => {}` |\r\n\r\nWith a script tag, options are passed as `data-*` attributes\r\n(`data-container`, `data-api-base-url`, `data-locale`, `data-view`…).\r\n\r\n## Views & navigation\r\n\r\n- **Cockpit** (default): AI chat, visualization canvas, dashboard management.\r\n- **Dashboard**: widgets (charts, tables) and insights.\r\n\r\nHash-based routing:\r\n\r\n```\r\n#/                  → cockpit\r\n#/dashboard/{uuid}  → matching dashboard\r\n```\r\n\r\nProgrammatic navigation:\r\n\r\n```js\r\nimport { navigate } from '@blunx/web-sdk';\r\nnavigate('/dashboard/abc-123');\r\n```\r\n\r\n## Integrations\r\n\r\n| Technology | Method |\r\n|---|---|\r\n| Plain HTML / PHP / Laravel Blade | `<script>` + loader |\r\n| React / Vue / Angular / Svelte | `npm install` + `init()` / `destroy()` |\r\n| Maximum isolation (widget) | Embed the SDK in an iframe |\r\n| Non-Laravel backend | Implement the REST `/api/blunx/*` contract in your language |\r\n\r\nReady-to-use integration examples are provided in\r\n[`test/demo/`](test/demo/README.md).\r\n\r\n## CSS isolation\r\n\r\nAll stylesheets (Blunx + Bootstrap + DataTables) are **pre-scoped** under\r\n`.blunx-root`, applied to the container by `init()`:\r\n\r\n- No style leaks into the host page (background, typography, scrollbars…).\r\n- Overlays, modals and the FAB are **anchored in the container**, never in the\r\n  `body` — nothing covers the rest of the page.\r\n- Only Font Awesome icons remain global (classes only).\r\n\r\nThe bundle also embeds the logo (data URI) and translations: **no static file\r\nto deploy**.\r\n\r\n## API contract\r\n\r\nThe SDK makes its **single** network call to the backend via `apiBaseUrl`,\r\nwhich must expose the REST contract `/api/blunx/*`:\r\n\r\n| Resource | Methods |\r\n|---|---|\r\n| `/api/blunx/user` | GET |\r\n| `/api/blunx/conversations` | GET, POST, DELETE |\r\n| `/api/blunx/conversations/{uuid}/messages` | GET |\r\n| `/api/blunx/messages` | POST, DELETE |\r\n| `/api/blunx/execute-sql` | POST |\r\n| `/api/blunx/dashboards` | GET, POST, DELETE |\r\n| `/api/blunx/widgets` | POST, PATCH, DELETE |\r\n| `/api/blunx/widgets/{uuid}/execute` | POST |\r\n| `/api/blunx/insights/*` | GET, POST, DELETE |\r\n| `/api/blunx/feedback` | POST |\r\n| `/api/blunx/stream` | POST (SSE) |\r\n\r\nThe SDK is therefore independent of the backend language (Laravel, Node,\r\nPython…).\r\n\r\n## Development\r\n\r\n```bash\r\nnpm install          # install build tools\r\nnpm run build        # → dist/blunx.min.js, blunx.esm.js, blunx-loader.min.js\r\nnpm run watch        # rebuild on every save\r\n```\r\n\r\nThe integration demos (HTML, PHP, React, Vue, Svelte, Angular, Next.js) and\r\ntest tools live in [`test/`](test/README.md). To run them:\r\n\r\n```bash\r\nnpm run demo:install # once: npm install for the framework demos\r\nnpm run demo:all     # mock API + dev servers + browser\r\n```\r\n\r\n`dist/` is **generated**: never edit files in `dist/`, work in `src/` then\r\n`npm run build`.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the\r\ncontributor guide (setup, conventions, pull request process).\r\n\r\n## Security\r\n\r\nIf you discover a vulnerability, please report it following the procedure\r\ndescribed in [`SECURITY.md`](SECURITY.md). Please **do not** open a public\r\nissue for a security problem.\r\n\r\n## Code of conduct\r\n\r\nThis project is committed to a respectful and inclusive environment. Anyone\r\nparticipating in the project (issues, PRs, discussions) must follow the\r\n[`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).\r\n\r\n## License\r\n\r\nDistributed under the [MIT](LICENSE) license. See `LICENSE` for details.\r\n\r\n","readmeFilename":"README.md"}