{"_id":"@dloizides/bff-web-client","_rev":"4-104f8f30e44149a391db47e69ef5094f","name":"@dloizides/bff-web-client","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.1":{"name":"@dloizides/bff-web-client","version":"1.0.1","keywords":["axios","bff","interceptors","http","csrf","dloizides"],"author":{"name":"dloizides"},"license":"MIT","_id":"@dloizides/bff-web-client@1.0.1","maintainers":[{"name":"dloizides","email":"loizidesdemetris@gmail.com"}],"homepage":"https://github.com/openmindednewby/bff-web-client#readme","bugs":{"url":"https://github.com/openmindednewby/bff-web-client/issues"},"dist":{"shasum":"81008ed6cf999c68c8f46d18b44e7cb0c0ccd788","tarball":"https://registry.npmjs.org/@dloizides/bff-web-client/-/bff-web-client-1.0.1.tgz","fileCount":10,"integrity":"sha512-Nk5ZlPqZ/xiX2zVtIl27BC+JZpx3hpWZHthMdwhptHJHjjnGaGpKC2hV7PiHApr4KDHKZNNbmSCrYVMGswriWg==","signatures":[{"sig":"MEYCIQCTtjJEwl5YALjJMFL2pFLck8hfgUsVNVsp6E2QxosF1QIhANNOKI5Kv35MajbK3Gv8JlsVrnusfmE7kvGT9u4R/kGN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":94279},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"7c150c4e3da4a998200f38a3bd4f21723a12c86b","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"rimraf dist && tsup","clean":"rimraf dist","lint:fix":"eslint src --ext .ts --fix","typecheck":"tsc --noEmit","test:watch":"jest --watch","build:watch":"tsup --watch","deps:health":"npm run deps:outdated && npm run deps:unused","deps:unused":"npx depcheck --ignores \"@types/jest,@types/node,rimraf\"","deps:licenses":"npx license-checker --onlyAllow \"MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;Unlicense;CC0-1.0\"","deps:outdated":"npm outdated || exit 0","test:coverage":"jest --coverage","prepublishOnly":"npm run clean && npm run build && npm run test","security:audit":"npm audit --audit-level=high"},"_npmUser":{"name":"dloizides","email":"loizidesdemetris@gmail.com"},"repository":{"url":"git+https://github.com/openmindednewby/bff-web-client.git","type":"git"},"_npmVersion":"10.9.3","description":"Product-agnostic RN-web BFF HTTP layer for the dloizides.com portfolio: an axios instance factory plus an interceptor chain (logging, success-toast normalizer, error classifier) with app-supplied ports for the CSRF strategy, session-expiry handling, toast","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.0.0","axios":"^1.13.4","eslint":"^8.57.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.4.0","@types/jest":"^29.5.0","@types/node":"^20.19.32","@dloizides/utils":"^1.0.2","eslint-plugin-sonarjs":"^4.0.3","jest-environment-jsdom":"^29.7.0","@typescript-eslint/parser":"^7.0.0","@dloizides/api-client-base":"^1.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"peerDependencies":{"axios":">=1.0.0","@dloizides/utils":"^1.0.0","@dloizides/api-client-base":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bff-web-client_1.0.1_1781444857626_0.28763359210962114","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@dloizides/bff-web-client","version":"1.1.0","keywords":["axios","bff","interceptors","http","csrf","dloizides"],"author":{"name":"dloizides"},"license":"MIT","_id":"@dloizides/bff-web-client@1.1.0","maintainers":[{"name":"dloizides","email":"loizidesdemetris@gmail.com"}],"homepage":"https://github.com/openmindednewby/bff-web-client#readme","bugs":{"url":"https://github.com/openmindednewby/bff-web-client/issues"},"dist":{"shasum":"8aca195b222392c056a2473e056ddd48bd96a230","tarball":"https://registry.npmjs.org/@dloizides/bff-web-client/-/bff-web-client-1.1.0.tgz","fileCount":10,"integrity":"sha512-YNs8+O6sXrGmaeH86H0RjoeWPzXZ/yJDf07FY+NQTW7WIsKDneF+D+M2w9YwEtogbcVoNLJnli7OMfUgg2TUFA==","signatures":[{"sig":"MEYCIQC1/UratKLN5OUOIQF668zuesbdM/SefGL2CJ6QPTDu2QIhAPvuFIPTqOPGIBhgIz7cFBcHm1SEt1ZxDFylV/UoLhAI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":118811},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"619afc8a75711ba183b2d61b7636662d1bf22cea","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"rimraf dist && tsup","clean":"rimraf dist","lint:fix":"eslint src --ext .ts --fix","typecheck":"tsc --noEmit","test:watch":"jest --watch","build:watch":"tsup --watch","deps:health":"npm run deps:outdated && npm run deps:unused","deps:unused":"npx depcheck --ignores \"@types/jest,@types/node,rimraf\"","deps:licenses":"npx license-checker --onlyAllow \"MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;Unlicense;CC0-1.0\"","deps:outdated":"npm outdated || exit 0","test:coverage":"jest --coverage","prepublishOnly":"npm run clean && npm run build && npm run test","security:audit":"npm audit --audit-level=high"},"_npmUser":{"name":"dloizides","email":"loizidesdemetris@gmail.com"},"repository":{"url":"git+https://github.com/openmindednewby/bff-web-client.git","type":"git"},"_npmVersion":"10.9.3","description":"Product-agnostic RN-web BFF HTTP layer for the dloizides.com portfolio: an axios instance factory plus an interceptor chain (logging, success-toast normalizer, error classifier) with app-supplied ports for the CSRF strategy, session-expiry handling, toast","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.0.0","axios":"^1.13.4","eslint":"^8.57.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.4.0","@types/jest":"^29.5.0","@types/node":"^20.19.32","@dloizides/utils":"^1.0.2","eslint-plugin-sonarjs":"^4.0.3","jest-environment-jsdom":"^29.7.0","@typescript-eslint/parser":"^7.0.0","@dloizides/api-client-base":"^1.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"peerDependencies":{"axios":">=1.0.0","@dloizides/utils":"^1.0.0","@dloizides/api-client-base":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bff-web-client_1.1.0_1783318762328_0.5046881759345752","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@dloizides/bff-web-client","version":"1.2.0","keywords":["axios","bff","interceptors","http","csrf","dloizides"],"author":{"name":"dloizides"},"license":"MIT","_id":"@dloizides/bff-web-client@1.2.0","maintainers":[{"name":"dloizides","email":"loizidesdemetris@gmail.com"}],"homepage":"https://github.com/openmindednewby/bff-web-client#readme","bugs":{"url":"https://github.com/openmindednewby/bff-web-client/issues"},"dist":{"shasum":"a4d6920aaf4cac3b0f3fe7455f08e36b931fa464","tarball":"https://registry.npmjs.org/@dloizides/bff-web-client/-/bff-web-client-1.2.0.tgz","fileCount":10,"integrity":"sha512-rtpz27PGOdZV30jpQRc4m9L9U6787b6wbhtqoGPFE04TSTrqAln6pbSpffJFCrzX6jsGMMYQ13TxS9VMSoKDaw==","signatures":[{"sig":"MEUCIQDa1ofRtaIqpvR3pj0siEfLJb3XG8YzQLkhj+CtD2tvzAIgT/q3iYbBYoAk6qJmb+y7JC6+xLR5SPetV97WMbjLLxU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":123179},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"c84d30b64da06a4dd5f37f49fb90b4af1ae9d58a","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"rimraf dist && tsup","clean":"rimraf dist","lint:fix":"eslint src --ext .ts --fix","typecheck":"tsc --noEmit","test:watch":"jest --watch","build:watch":"tsup --watch","deps:health":"npm run deps:outdated && npm run deps:unused","deps:unused":"npx depcheck --ignores \"@types/jest,@types/node,rimraf\"","deps:licenses":"npx license-checker --onlyAllow \"MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;Unlicense;CC0-1.0\"","deps:outdated":"npm outdated || exit 0","test:coverage":"jest --coverage","prepublishOnly":"npm run clean && npm run build && npm run test","security:audit":"npm audit --audit-level=high"},"_npmUser":{"name":"dloizides","email":"loizidesdemetris@gmail.com"},"repository":{"url":"git+https://github.com/openmindednewby/bff-web-client.git","type":"git"},"_npmVersion":"10.9.3","description":"Product-agnostic RN-web BFF HTTP layer for the dloizides.com portfolio: an axios instance factory plus an interceptor chain (logging, success-toast normalizer, error classifier) with app-supplied ports for the CSRF strategy, session-expiry handling, toast","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^8.0.0","axios":"^1.13.4","eslint":"^8.57.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","typescript":"^5.4.0","@types/jest":"^29.5.0","@types/node":"^20.19.32","@dloizides/utils":"^1.0.2","eslint-plugin-sonarjs":"^4.0.3","jest-environment-jsdom":"^29.7.0","@typescript-eslint/parser":"^7.0.0","@dloizides/api-client-base":"^1.0.0","@typescript-eslint/eslint-plugin":"^7.0.0"},"peerDependencies":{"axios":">=1.0.0","@dloizides/utils":"^1.0.0","@dloizides/api-client-base":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/bff-web-client_1.2.0_1783632153983_0.06605090924878176","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@dloizides/bff-web-client","version":"1.3.0","description":"Product-agnostic RN-web BFF HTTP layer for the dloizides.com portfolio: an axios instance factory plus an interceptor chain (logging, success-toast normalizer, error classifier) with app-supplied ports for the CSRF strategy, session-expiry handling, toast","keywords":["axios","bff","interceptors","http","csrf","dloizides"],"author":{"name":"dloizides"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/openmindednewby/bff-web-client.git"},"homepage":"https://github.com/openmindednewby/bff-web-client#readme","bugs":{"url":"https://github.com/openmindednewby/bff-web-client/issues"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"./testing":{"require":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"import":{"types":"./dist/testing/index.d.mts","default":"./dist/testing/index.mjs"}}},"sideEffects":false,"engines":{"node":">=18.0.0"},"scripts":{"build":"rimraf dist && tsup","build:watch":"tsup --watch","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","lint":"eslint src --ext .ts","lint:fix":"eslint src --ext .ts --fix","typecheck":"tsc --noEmit","clean":"rimraf dist","security:audit":"npm audit --audit-level=high","deps:outdated":"npm outdated || exit 0","deps:unused":"npx depcheck --ignores \"@types/jest,@types/node,rimraf\"","deps:licenses":"npx license-checker --onlyAllow \"MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;Unlicense;CC0-1.0\"","deps:health":"npm run deps:outdated && npm run deps:unused","prepublishOnly":"npm run clean && npm run build && npm run test"},"peerDependencies":{"@dloizides/api-client-base":"^1.0.0","@dloizides/utils":"^1.0.0","axios":">=1.0.0"},"devDependencies":{"@dloizides/api-client-base":"^1.0.0","@dloizides/utils":"^1.0.2","@types/jest":"^29.5.0","@types/node":"^20.19.32","@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","axios":"^1.13.4","eslint":"^8.57.0","eslint-plugin-sonarjs":"^4.0.3","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","rimraf":"^5.0.0","ts-jest":"^29.1.0","tsup":"^8.0.0","typescript":"^5.4.0"},"_id":"@dloizides/bff-web-client@1.3.0","gitHead":"31dc7e0df50bd4b6499c0a764c3e572c5158f377","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-TwYrZ64M8h5VaK206znge7U2z+PyAom7qW9Lnm5zHMdhqxC8RwDWDycicdGt6+dfIHxd2tZufFQLosX47/e7VQ==","shasum":"e824640544e7288b5baf530029d39413956004ff","tarball":"https://registry.npmjs.org/@dloizides/bff-web-client/-/bff-web-client-1.3.0.tgz","fileCount":16,"unpackedSize":182572,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC2uUIGCjCSoPNGMBZs3qFAI85iDRPGx8s6vfCTy+gv9wIgSTZdCwPNzbkZ2viu88f1EycNGd8uIMUH0BJPawOQ0Sg="}]},"_npmUser":{"name":"dloizides","email":"loizidesdemetris@gmail.com"},"directories":{},"maintainers":[{"name":"dloizides","email":"loizidesdemetris@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bff-web-client_1.3.0_1788701920566_0.6124599618206195"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-14T13:47:37.449Z","modified":"2026-09-06T13:38:40.821Z","1.0.1":"2026-06-14T13:47:37.792Z","1.1.0":"2026-07-06T06:19:22.474Z","1.2.0":"2026-07-09T21:22:34.143Z","1.3.0":"2026-09-06T13:38:40.685Z"},"bugs":{"url":"https://github.com/openmindednewby/bff-web-client/issues"},"author":{"name":"dloizides"},"license":"MIT","homepage":"https://github.com/openmindednewby/bff-web-client#readme","keywords":["axios","bff","interceptors","http","csrf","dloizides"],"repository":{"type":"git","url":"git+https://github.com/openmindednewby/bff-web-client.git"},"description":"Product-agnostic RN-web BFF HTTP layer for the dloizides.com portfolio: an axios instance factory plus an interceptor chain (logging, success-toast normalizer, error classifier) with app-supplied ports for the CSRF strategy, session-expiry handling, toast","maintainers":[{"name":"dloizides","email":"loizidesdemetris@gmail.com"}],"readme":"# @dloizides/bff-web-client\n\nProduct-agnostic RN-web **BFF HTTP layer** for the dloizides.com portfolio.\n\nIt owns the axios instance factory and the interceptor chain (logging, success\ntoast normalizer, error classifier) that `erevna-web` and `katalogos-web` shared\nbyte-for-byte. Every app-specific concern is a **port** the consuming app\nsupplies — its logger, its toast emitter, its CSRF strategy, and its\nsession-expiry handler. The package never imports a product, realm, or hardcoded\nURL, and pairs with `@dloizides/api-client-base` by composition.\n\n## Install\n\n```bash\nnpm install @dloizides/bff-web-client\n```\n\nPeer deps: `axios`, `@dloizides/api-client-base`, `@dloizides/utils`.\n\n## Usage\n\n```ts\nimport {\n  createBffAxiosClient,\n  registerInterceptors,\n} from '@dloizides/bff-web-client';\n\nimport { apiEventBus } from '@dloizides/api-client-base';\nimport { logger } from './my-logger';\nimport { registerCsrfInterceptor } from './csrfInterceptor'; // app-owned\nimport { registerSessionExpiryInterceptor } from './sessionExpiry'; // app-owned\n\nexport const apiClient = createBffAxiosClient({ timeoutMs: 30_000 });\n\nregisterInterceptors(apiClient, {\n  logger,\n  emitToast: (message, severity) =>\n    apiEventBus.emit({ type: 'toast', severity, message }),\n  csrf: registerCsrfInterceptor,\n  onSessionExpiry: registerSessionExpiryInterceptor,\n});\n```\n\n## API\n\n### `createBffAxiosClient(options)`\n\n| option      | type                       | description                                          |\n| ----------- | -------------------------- | ---------------------------------------------------- |\n| `timeoutMs` | `number`                   | Request timeout in milliseconds.                     |\n| `baseURL`   | `string` (optional)        | Omit for same-origin (relative) BFF requests.        |\n| `headers`   | `Record<string,string>`    | Extra default headers merged over the BFF defaults.  |\n\nReturns a credentialed `AxiosInstance` with **no** interceptors registered.\n\n### `registerInterceptors(instance, ports)`\n\n| port             | type                                   | required | description                                                          |\n| ---------------- | -------------------------------------- | -------- | -------------------------------------------------------------------- |\n| `logger`         | `BffLogger`                            | yes      | Structured logger the package logs through.                          |\n| `emitToast`      | `(message, severity) => void`          | yes      | Called when a mutating request succeeds.                            |\n| `csrf`           | `(instance) => void`                   | no       | App CSRF registrar. Defaults to `X-BFF-Csrf: 1` on mutations.        |\n| `onSessionExpiry`| `(instance) => void`                   | no       | App session-expiry registrar (app owns its session store).          |\n\nChain order (matches the pre-extraction behaviour):\n\n- **Request** (reverse execution): logging is registered first (runs last),\n  CSRF registered second (runs first).\n- **Response** (execution order): logging → normalizer → session expiry →\n  error classifier.\n\n### Individual registrars\n\n`registerLoggingInterceptor`, `registerResponseNormalizer`,\n`registerErrorClassifier`, `registerDefaultCsrfInterceptor` — exported for\ncustom chains.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}