{"_id":"@ambiten/adapter-lambda","_rev":"3-47182e962605a8ec26723c5a1af14807","name":"@ambiten/adapter-lambda","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@ambiten/adapter-lambda","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@ambiten/adapter-lambda@1.0.0","maintainers":[{"name":"abimongo","email":"padave805@gmail.com"}],"homepage":"https://ambiten.dev","bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"dist":{"shasum":"c4e2afaec4ca8ec63445f935c6144e92f5703a2a","tarball":"https://registry.npmjs.org/@ambiten/adapter-lambda/-/adapter-lambda-1.0.0.tgz","fileCount":19,"integrity":"sha512-55oo5L/PsHCBxpC+IxHn74OuQbI9pdKozQRq6Ex5OCWmODD7mLiA6dfXixSFIvK9iS920jrdE2XH6oPU3KYJBg==","signatures":[{"sig":"MEUCIQCfFTdJ5IPJMu8hHA1IlZ4iYNvKw/h5+WF4mrl0BSqE1wIgEgGzPgRIzfo6x01gwV/CoF6FuRxBPbQck4qiuzRNkMc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19195},"main":"./dist/index.js","_from":"file:ambiten-adapter-lambda-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:lambda","clean":"rimraf dist","release":"pnpm changeset version","changeset":"pnpm run changeset","build:lambda":"tsc -p tsconfig.json"},"_npmUser":{"name":"abimongo","email":"padave805@gmail.com"},"_resolved":"/tmp/4cc40f19b02a07868f58b24a1079e55d/ambiten-adapter-lambda-1.0.0.tgz","_integrity":"sha512-55oo5L/PsHCBxpC+IxHn74OuQbI9pdKozQRq6Ex5OCWmODD7mLiA6dfXixSFIvK9iS920jrdE2XH6oPU3KYJBg==","repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-lambda"},"_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-lambda</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","typedoc":"^0.28.18","typescript":"^5.9.3","@types/jest":"^29.5.14","typedoc-plugin-markdown":"^4.11.0","@testing-library/jest-dom":"^6.9.1"},"_npmOperationalInternal":{"tmp":"tmp/adapter-lambda_1.0.0_1781347258153_0.9403161190629554","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ambiten/adapter-lambda","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"@ambiten/adapter-lambda@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":"8d912684b653fb3079bb07d5c348c1e524aa2adc","tarball":"https://registry.npmjs.org/@ambiten/adapter-lambda/-/adapter-lambda-1.0.1.tgz","fileCount":19,"integrity":"sha512-oksbRJRUICkL3QI5wDyHMUu8A1UOKjO0R2CADsquH/wzH+A1tD/P0hgb012ZqL6gtibObOeS7+PYCGkSHBnaCQ==","signatures":[{"sig":"MEQCIFN5XpTtZEa6byNF/rz/a2Qi1n7Llnq1SMPyRg3xnjOFAiAg+c0V+GB3NX9ixS+I/4dPyrXd5fjCzS3TjvMlUdHM4g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIFC9dD/ZLBZF9Nh2FDdR7+q22+FbbJlkmHnHcHQ58gLaAiBJzRoleRjVhRvG3mC6ZInKR3pgGcGkPdPomzc6KiQ4Xg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19207},"main":"./dist/index.js","_from":"file:ambiten-adapter-lambda-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:lambda","clean":"rimraf dist","release":"pnpm changeset version","changeset":"pnpm run changeset","build:lambda":"tsc -p tsconfig.json"},"_npmUser":{"name":"abimongo","email":"padave805@gmail.com"},"_resolved":"/tmp/ad7161a505b97d601381862ccc6e3733/ambiten-adapter-lambda-1.0.1.tgz","_integrity":"sha512-oksbRJRUICkL3QI5wDyHMUu8A1UOKjO0R2CADsquH/wzH+A1tD/P0hgb012ZqL6gtibObOeS7+PYCGkSHBnaCQ==","repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-lambda"},"_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-lambda</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","typedoc":"^0.28.18","typescript":"^5.9.3","@types/jest":"^29.5.14","typedoc-plugin-markdown":"^4.11.0","@testing-library/jest-dom":"^6.9.1"},"_npmOperationalInternal":{"tmp":"tmp/adapter-lambda_1.0.1_1789148321323_0.14497216293582826","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"_id":"@ambiten/adapter-lambda@1.0.2","bugs":{"url":"https://github.com/AmbitenHQ/ambiten/issues"},"dist":{"shasum":"b76ba469b62bdf7c39dd9f7cc3f6891a2b08f812","tarball":"https://registry.npmjs.org/@ambiten/adapter-lambda/-/adapter-lambda-1.0.2.tgz","fileCount":36,"integrity":"sha512-TWVjhrs5VrpGZg2BvSJI4KgXDHWkZKX5XmIRrKgiDWUBzMSRlp6iz0zxwR7t6bxzyQYGMSKaCImTgKZkvnurNg==","signatures":[{"sig":"MEUCIQD4SY9SfXMBlquwQ74Y9rYy6WBuku1h/zMKXwALL2XVRQIgaJ9FiJznS93zH3Xkr3I0FxNqt7MbwBVyF+F+osVCpWY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCdbirsju5rAX0iQLwCvHkoIqobeDUksJKnKk85/IdHKAIhALT7z5+8m3nhcrPSFistol2nKYAXkGkgjTOQlGccqsaf"}],"unpackedSize":30963},"main":"./dist/cjs/index.js","name":"@ambiten/adapter-lambda","_from":"file:ambiten-adapter-lambda-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-lambda","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/1be64850e1f1973862a52d83235d9799/ambiten-adapter-lambda-1.0.2.tgz","_integrity":"sha512-TWVjhrs5VrpGZg2BvSJI4KgXDHWkZKX5XmIRrKgiDWUBzMSRlp6iz0zxwR7t6bxzyQYGMSKaCImTgKZkvnurNg==","repository":{"url":"git+https://github.com/AmbitenHQ/ambiten.git","type":"git","directory":"packages/adapter-lambda"},"_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-lambda</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","typedoc":"^0.28.18","typescript":"^5.9.3","@types/jest":"^29.5.14","typedoc-plugin-markdown":"^4.11.0","@testing-library/jest-dom":"^6.9.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adapter-lambda_1.0.2_1789381855651_0.4469272300674596"}}},"time":{"created":"2026-06-13T10:40:58.020Z","modified":"2026-09-14T10:30:55.920Z","1.0.0":"2026-06-13T10:40:58.302Z","1.0.1":"2026-09-11T17:38:41.424Z","1.0.2":"2026-09-14T10:30:55.735Z"},"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-lambda"},"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-lambda</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-lambda</h2>\n</div>  \n\n<p align=\"center\">\n  <strong>AWS Lambda integration for the Ambiten runtime.</strong>\n</p>\n\n<p align=\"center\">\n  Establish runtime execution boundaries for serverless workloads while preserving context propagation, multi-tenancy, observability, and transaction-aware execution across Lambda invocations.\n</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@ambiten/adapter-lambda\">\n    <img src=\"https://img.shields.io/npm/v/@ambiten/adapter-lambda?style=flat-square\" alt=\"npm version\" />\n  </a>\n  <!-- <a href=\"https://ambiten.dev\">\n    <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---\n\n## Overview\n\n`@ambiten/adapter-lambda` connects AWS Lambda functions to the Ambiten runtime.\n\nThe adapter establishes an execution boundary for each Lambda invocation so runtime context remains available throughout the lifecycle of the function. Tenant information, request metadata, logging, instrumentation, transactions, and runtime services can then participate consistently across handlers, services, and model operations.\n\nThe adapter does not replace Lambda. It allows serverless execution to participate fully in the Ambiten runtime model.\n\n## Installation\n\n```bash\nnpm install @ambiten/core @ambiten/adapter-lambda\n```\n\n## Quick Start\n\n```ts\nimport {\n  AmbitenBootstrapFactory\n} from \"@ambiten/core\";\n\nimport {\n  createLambdaAdapter\n} from \"@ambiten/adapter-lambda\";\n\nconst adapter = createLambdaAdapter();\n\nconst bootstrap =\n  await AmbitenBootstrapFactory.create({\n    adapter\n  });\n\nexport const handler =\n  adapter.wrap(async (event, context) => {\n    return {\n      statusCode: 200,\n      body: JSON.stringify({\n        success: true\n      })\n    };\n  });\n```\n\nEach invocation automatically participates in the Ambiten execution model.\n\n## What the Adapter Provides\n\nThe adapter acts as the bridge between AWS Lambda and the runtime.\n\nIt can establish invocation-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 function handlers to remain focused on business logic while execution concerns remain coordinated by the runtime.\n\n## Runtime Flow\n\n```text\nLambda Invocation\n        ↓\nLambda Adapter\n        ↓\nAmbitenContext\n        ↓\nServices\n        ↓\nModels\n        ↓\nMongoDB\n```\n\nThe adapter creates the execution boundary. The runtime then carries execution state throughout the remainder of the invocation lifecycle.\n\n## Invocation Context\n\nServerless applications frequently require request information to remain available across asynchronous execution paths.\n\nThe adapter can automatically expose invocation metadata through the runtime context so services and models can access request-scoped information without manually passing it between layers.\n\n```text\nLambda Event\n      ↓\nRuntime Context\n      ↓\nService Layer\n      ↓\nModel Operations\n```\n\nExecution context remains attached throughout the entire invocation.\n\n## Multi-Tenancy\n\nWhen multi-tenancy is enabled, tenant information can be resolved from the incoming event and made available throughout the active runtime context.\n\n```text\nLambda Event\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 propagating tenant identifiers through the application.\n\n## Serverless Execution\n\nUnlike traditional servers, Lambda functions execute inside short-lived invocation boundaries.\n\nThe adapter is designed around this model and ensures runtime state is isolated per invocation while still allowing logging, instrumentation, transactions, and context propagation to behave consistently.\n\nThis makes it possible to share the same runtime model across serverless functions, APIs, workers, and long-running services.\n\n## Observability\n\nLogs, instrumentation events, and runtime metadata generated during an invocation remain correlated through the active runtime context.\n\nThis helps preserve operational visibility across distributed systems where requests may pass through multiple serverless functions before completing.\n\n## Documentation\n\nComplete documentation is available at:\n\nhttps://docs.ambiten.dev\n\n## Related Packages\n\n* `@ambiten/core`\n* `@ambiten/logger`\n* `@ambiten/create`\n\n## License\n\nMIT\n","readmeFilename":"README.md"}