{"_id":"@ambiten/adapter-fastify","_rev":"3-a7c42b46b8a512ed01bb79db772bdf95","name":"@ambiten/adapter-fastify","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@ambiten/adapter-fastify","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@ambiten/adapter-fastify@1.0.0","maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"homepage":"https://ambiten.dev","bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"dist":{"shasum":"38b079ee23e9ce26d520bd23f6331e38b7ad92c5","tarball":"https://registry.npmjs.org/@ambiten/adapter-fastify/-/adapter-fastify-1.0.0.tgz","fileCount":11,"integrity":"sha512-Rb2XYcQyvwqLaI4sRBY8Al643tdPX5t4Of+GxDxPVwzCzA7mSaUnZwwrHt3hEzJYDWG8df5pQqDVOgotToCzaQ==","signatures":[{"sig":"MEUCIHsu6AYDbZv1YrmYWAR2OOvHdbbwx4mfOHbqeW07owu5AiEAkPttX/YeTphCeRmGv7i/EAVGHZG4qVJikKgg3rr10+s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12759},"main":"./dist/index.js","_from":"file:ambiten-adapter-fastify-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.11.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"test":"jest --detectOpenHandles --coverage","build":"pnpm -r run build:script","clean":"rimraf dist","release":"pnpm changeset version","changeset":"pnpm run changeset","build:script":"tsc -p tsconfig.json"},"_npmUser":{"name":"abimongo","email":"padave805@gmail.com"},"_resolved":"/tmp/c6cf17a77def3e361bf7aa655762c448/ambiten-adapter-fastify-1.0.0.tgz","_integrity":"sha512-Rb2XYcQyvwqLaI4sRBY8Al643tdPX5t4Of+GxDxPVwzCzA7mSaUnZwwrHt3hEzJYDWG8df5pQqDVOgotToCzaQ==","repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-fastify"},"_npmVersion":"11.17.0","description":"<div style=\"display: flex; align-items: center;\"> <p >   <img     src=\"https://raw.githubusercontent.com/AmbitenHQ/ambiten/main/assets/ambiten-mark-192x192.png\"     width=\"56\"     alt=\"Ambiten\"   />   </p> <h2> @ambiten/adapter-fastify</h2> </div>","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@ambiten/adapter-types":"1.0.0","@ambiten/adapter-runtime":"1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.9","typescript":"^5.9.3","@types/jest":"^29.5.14","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"fastify":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/adapter-fastify_1.0.0_1781347257887_0.053760605602227285","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ambiten/adapter-fastify","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"@ambiten/adapter-fastify@1.0.1","maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"homepage":"https://docs.ambiten.dev","bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"dist":{"shasum":"ebd491e43bad9e262213a70b1bf257fa459d4371","tarball":"https://registry.npmjs.org/@ambiten/adapter-fastify/-/adapter-fastify-1.0.1.tgz","fileCount":11,"integrity":"sha512-1rv7rL6ZZrgtoTSnqT3jAI0fMhxHLXq1NPhD7/uEYA9GTQtlvR/wvclvsvEXyrhVJhPLK53F6TPfHXoa+hm/9A==","signatures":[{"sig":"MEUCIQCc0UmZL2Ks9V3cHPFg/UObCSEIt7I7UD9pYNGghdIlxQIgXWWmOicSbd+CEZQg+C5hZJTWe+l1Es9skMJj0GclTU0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIHK6qD2NGQEPSYOwY/WEaiwrhMKWp7DyBCHRfy30LGHUAiEA6YGTN9A4r7mrjv0tPqY9qEqkWAXnZ22/I6eCG2y6I/g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12771},"main":"./dist/index.js","_from":"file:ambiten-adapter-fastify-1.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.11.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"scripts":{"test":"jest --detectOpenHandles --coverage","build":"pnpm -r run build:script","clean":"rimraf dist","release":"pnpm changeset version","changeset":"pnpm run changeset","build:script":"tsc -p tsconfig.json"},"_npmUser":{"name":"abimongo","email":"padave805@gmail.com"},"_resolved":"/tmp/3fcc1474b14ea0e79a79480dac59281f/ambiten-adapter-fastify-1.0.1.tgz","_integrity":"sha512-1rv7rL6ZZrgtoTSnqT3jAI0fMhxHLXq1NPhD7/uEYA9GTQtlvR/wvclvsvEXyrhVJhPLK53F6TPfHXoa+hm/9A==","repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-fastify"},"_npmVersion":"12.0.2","description":"<div style=\"display: flex; align-items: center;\"> <p >   <img     src=\"https://raw.githubusercontent.com/AmbitenHQ/ambiten/main/assets/ambiten-mark-192x192.png\"     width=\"56\"     alt=\"Ambiten\"   />   </p> <h2> @ambiten/adapter-fastify</h2> </div>","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@ambiten/adapter-types":"^1.0.0","@ambiten/adapter-runtime":"^1.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.9","typescript":"^5.9.3","@types/jest":"^29.5.14","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"fastify":"^5.6.2"},"_npmOperationalInternal":{"tmp":"tmp/adapter-fastify_1.0.1_1789148322448_0.3271825368400767","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"_id":"@ambiten/adapter-fastify@1.0.2","bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"dist":{"shasum":"d604614f5717fe16e0dddee7ef2a3da754b9bd3f","tarball":"https://registry.npmjs.org/@ambiten/adapter-fastify/-/adapter-fastify-1.0.2.tgz","fileCount":20,"integrity":"sha512-NcL0GkH5TgFznrGqEYXrJvy+qa47PCwcWqXgh6yNjVkKRwaXpTiTiLO5EggPSYjctAeA1FzFnLVPu9TJ9THWVQ==","signatures":[{"sig":"MEUCIQCFrKVlcDm2zZSEBDRJzo9KQE0tf1rCL6EtRmP0z/u65gIgIM39m91396hbxL5biI+h4DGb0vXrZAjf7qY75eLR/LI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAY+j5PqehKBo+ypb9ZWYCdHLa2iksLtuqE8bKExTrCAAiEAx3R1K3bsiu9bRfXXHn5/e8cj0AC7BKEkxEoRY2Hwkt8="}],"unpackedSize":19083},"main":"./dist/cjs/index.js","name":"@ambiten/adapter-fastify","_from":"file:ambiten-adapter-fastify-1.0.2.tgz","types":"./dist/esm/index.d.ts","author":"","module":"./dist/esm/index.js","engines":{"node":">=20.11.0"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"license":"ISC","scripts":{"test":"jest --detectOpenHandles --coverage","build":"pnpm run clean && pnpm run build:esm && pnpm run build:cjs","clean":"rimraf dist && rimraf ../../.cache/tsbuildinfo/adapter-fastify","release":"pnpm changeset version","build:cjs":"tsc -b tsconfig.json -force && node scripts/fix-esm-extensions.mjs","build:esm":"tsc -b tsconfig.esm.json -force","changeset":"pnpm run changeset","postbuild:esm":"node scripts/add-esm-type.js"},"version":"1.0.2","_npmUser":{"name":"abimongo","email":"padave805@gmail.com"},"homepage":"https://docs.ambiten.dev","keywords":[],"_resolved":"/tmp/04dc36f64a15ff70045b5fe1de4a482a/ambiten-adapter-fastify-1.0.2.tgz","_integrity":"sha512-NcL0GkH5TgFznrGqEYXrJvy+qa47PCwcWqXgh6yNjVkKRwaXpTiTiLO5EggPSYjctAeA1FzFnLVPu9TJ9THWVQ==","repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-fastify"},"_npmVersion":"12.0.2","description":"<div style=\"display: flex; align-items: center;\"> <p >   <img     src=\"https://raw.githubusercontent.com/AmbitenHQ/ambiten/main/assets/ambiten-mark-192x192.png\"     width=\"56\"     alt=\"Ambiten\"   />   </p> <h2> @ambiten/adapter-fastify</h2> </div>","directories":{},"maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@ambiten/adapter-types":"^1.0.1","@ambiten/adapter-runtime":"^1.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.9","typescript":"^5.9.3","@types/jest":"^29.5.14","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"fastify":"^5.6.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adapter-fastify_1.0.2_1789381928243_0.8440017415502203"}}},"time":{"created":"2026-06-13T10:40:57.691Z","modified":"2026-09-14T10:32:08.495Z","1.0.0":"2026-06-13T10:40:58.033Z","1.0.1":"2026-09-11T17:38:42.538Z","1.0.2":"2026-09-14T10:32:08.314Z"},"bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"license":"ISC","homepage":"https://docs.ambiten.dev","keywords":[],"repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-fastify"},"description":"<div style=\"display: flex; align-items: center;\"> <p >   <img     src=\"https://raw.githubusercontent.com/AmbitenHQ/ambiten/main/assets/ambiten-mark-192x192.png\"     width=\"56\"     alt=\"Ambiten\"   />   </p> <h2> @ambiten/adapter-fastify</h2> </div>","maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"readme":"<div style=\"display: flex; align-items: center;\">\n<p >\n  <img\n    src=\"https://raw.githubusercontent.com/AmbitenHQ/ambiten/main/assets/ambiten-mark-192x192.png\"\n    width=\"56\"\n    alt=\"Ambiten\"\n  />  \n</p> <h2> @ambiten/adapter-fastify</h2>\n</div>  \n\n<p align=\"center\"> <strong>Fastify integration for the Ambiten runtime.</strong>\n</p>\n\n<p align=\"center\"> Establish request-scoped execution boundaries, context propagation, multi-tenancy, and transaction-aware runtime behavior inside Fastify applications. </p>\n\n <p align=\"center\"> \n  <a href=\"https://www.npmjs.com/package/@ambiten/adapter-fastify\"> <img src=\"https://img.shields.io/npm/v/@ambiten/adapter-fastify?style=flat-square\" alt=\"npm version\" /> \n </a>\n  <!-- <a href=\"https://ambiten.dev\"> <img src=\"https://img.shields.io/badge/docs-ambiten.dev-22c55e?style=flat-square\" alt=\"documentation\" />\n</a> -->\n  <a href=\"https://github.com/AmbitenHQ/ambiten/stargazers\">\n    <img src=\"https://img.shields.io/github/stars/AmbitenHQ/ambiten?style=flat-square&color=1E88E5\" alt=\"GitHub stars\" />\n  </a>\n </p>\n\n## Overview\n\n`@ambiten/adapter-fastify` connects Fastify applications to the Ambiten runtime.\n\nThe adapter establishes request execution boundaries using Fastify's lifecycle hooks so runtime context remains available throughout the lifecycle of each request. Tenant information, request metadata, transactions, logging, instrumentation, and runtime services can then participate consistently across handlers, plugins, services, and model operations.\n\nThe adapter does not replace Fastify. It allows Fastify to operate as an execution entry point for the Ambiten runtime.\n\n## Installation\n\n```text\nnpm install @ambiten/adapter-fastify\n```\n\nIf you are starting a new application, installing the core runtime is also recommended:\n\n```bash\nnpm install @ambiten/core @ambiten/adapter-fastify\n```\n\n## Quick Start\n\n```text\nimport Fastify from \"fastify\";\nimport { AmbitenBootstrapFactory } from \"@ambiten/core\";\nimport { createFastifyAdapter } from \"@ambiten/adapter-fastify\";\n\nconst app = Fastify();\n\nconst adapter = createFastifyAdapter();\n\nconst bootstrap =\n  await AmbitenBootstrapFactory.create({\n    adapter\n  });\n\nawait bootstrap.registerMultiTenancy(app);\n\nawait app.listen({\n  port: 3000\n});\n```\n\nOnce installed, incoming requests automatically participate in the Ambiten execution model.\n\n## What the Adapter Provides\n\nThe adapter acts as the bridge between Fastify and the runtime.\n\nIt can establish request-scoped context, initialize tenant boundaries, propagate request metadata, participate in transaction-aware execution flows, and expose runtime state to downstream services and models.\n\nThis allows application code to remain focused on business logic while execution concerns remain coordinated by the runtime.\n\nRuntime Flow\n\n```text\nIncoming Request\n        ↓\nFastify\n        ↓\nAmbiten Adapter\n        ↓\nAmbitenContext\n        ↓\nModels & Services\n        ↓\nMongoDB\n```\n\nThe adapter creates the execution boundary. The runtime then carries execution state throughout the remainder of the request lifecycle.\n\n## Fastify Integration\n\nThe adapter integrates directly with Fastify's request lifecycle and plugin system.\n\nRuntime context is established before application handlers execute and remains available throughout middleware, services, model operations, transactions, and asynchronous execution paths triggered by the request.\n\nThis ensures runtime state remains consistent while preserving Fastify's performance-oriented architecture.\n\n## Multi-Tenancy\n\nWhen multi-tenancy is enabled, tenant information can be resolved from incoming requests and made available throughout the active runtime context.\n\n```text\nRequest\n   ↓\nTenant Resolution\n   ↓\nAmbitenContext\n   ↓\nTenant-Aware Execution\n```\n\nThis allows models and services to operate against the correct tenant boundary without manually passing tenant identifiers through application layers.\n\n## Documentation\n\nComplete documentation is available at:\n\nhttps://docs.ambiten.dev\n\n- Related Packages\n- @ambiten/core\n- @ambiten/logger\n- @ambiten/create\n\n## License\n\nMIT\n","readmeFilename":"README.md"}