{"_id":"@standardserver/aws-lambda","_rev":"8-3e10c610e18e503afbd404ff63cb1429","name":"@standardserver/aws-lambda","dist-tags":{"latest":"0.8.3"},"versions":{"0.6.0":{"name":"@standardserver/aws-lambda","version":"0.6.0","license":"MIT","_id":"@standardserver/aws-lambda@0.6.0","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://standardserver.dev","dist":{"shasum":"e191c8104d63b88c42be02d05e919c76c34f8554","tarball":"https://registry.npmjs.org/@standardserver/aws-lambda/-/aws-lambda-0.6.0.tgz","fileCount":6,"integrity":"sha512-67wHQ6Hx5btYe8QCbxku+dd21nzL6WNxpt4+Q0WiBuMI5Xy8zNlTzCVnKENFCpj8M3Lv7GYV1ImJACZQ3Cfwxw==","signatures":[{"sig":"MEUCIHC4+m/sK/awsUtLLhYpy/S18hVjxhgdb7SkE0inPqnIAiEA5JG/sCsJhk2eQcmlJtC7ne3l7z+Fn7vlEIQFijZ4fn4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49035},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json"},"scripts":{"build":"unbuild","type:check":"tsc -b"},"_npmUser":{"name":"dinwwwh","email":"dinwwwh@gmail.com"},"repository":{"url":"git+https://github.com/middleapi/standardserver.git","type":"git","directory":"packages/aws-lambda"},"directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","dependencies":{"@standardserver/core":"0.6.0","@standardserver/node":"0.6.0","@standardserver/fetch":"0.6.0","@standardserver/shared":"0.6.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^26.0.0","@types/aws-lambda":"^8.10.162"},"_npmOperationalInternal":{"tmp":"tmp/aws-lambda_0.6.0_1785645126640_0.7937587091062044","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.7.0":{"name":"@standardserver/aws-lambda","version":"0.7.0","license":"MIT","_id":"@standardserver/aws-lambda@0.7.0","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://standardserver.dev","dist":{"shasum":"c085774f7b3bc71c7fd88e8e5ff8d32abe1f6ac0","tarball":"https://registry.npmjs.org/@standardserver/aws-lambda/-/aws-lambda-0.7.0.tgz","fileCount":6,"integrity":"sha512-KVin/3hgGd5Ome+u6Fk3kZpTZBeOcpLIrSluqMOUZkkedGgXLyJ2BVFyueNBB8Lk3nusEHTWq/kj/dquB/AHxQ==","signatures":[{"sig":"MEYCIQDycov0j4b+6/QqLH5PigBbc3CDuwb999UxZ8OqmnZ+9wIhAJkyAqWeLH/xm46OPy07kPmOxH7WVPeQP4R65cD02LH9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@standardserver%2faws-lambda@0.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49072},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json"},"scripts":{"build":"unbuild","type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73af2003-0422-4b29-a510-00d0e12c51c1"}},"repository":{"url":"git+https://github.com/middleapi/standardserver.git","type":"git","directory":"packages/aws-lambda"},"directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"@standardserver/core":"0.7.0","@standardserver/node":"0.7.0","@standardserver/fetch":"0.7.0","@standardserver/shared":"0.7.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^26.1.2","@types/aws-lambda":"^8.10.162"},"_npmOperationalInternal":{"tmp":"tmp/aws-lambda_0.7.0_1785726790579_0.5514359440178833","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.7.1":{"name":"@standardserver/aws-lambda","version":"0.7.1","license":"MIT","_id":"@standardserver/aws-lambda@0.7.1","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://standardserver.dev","dist":{"shasum":"81643ef9f9b7476647ca38e0baeb4092c49f9486","tarball":"https://registry.npmjs.org/@standardserver/aws-lambda/-/aws-lambda-0.7.1.tgz","fileCount":6,"integrity":"sha512-fuwAx2M2O5Bnjk2JdFrtEQALmBwVtnn4jKApzFVmlIivWA7EGMj5kOzCNaJizxCQXlhPmC+doDHqf/H7FKMaNA==","signatures":[{"sig":"MEUCIQCY3AV2SXjENCIneb830zWb0pXKNqMUlhyZF5DoLN6fGQIgQlM141aRzRw92MFdCdT6U0RwIqiPz6MZdO5EK1wjMyA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@standardserver%2faws-lambda@0.7.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49359},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json"},"scripts":{"build":"unbuild","type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73af2003-0422-4b29-a510-00d0e12c51c1"}},"repository":{"url":"git+https://github.com/middleapi/standardserver.git","type":"git","directory":"packages/aws-lambda"},"directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"@standardserver/core":"0.7.1","@standardserver/node":"0.7.1","@standardserver/fetch":"0.7.1","@standardserver/shared":"0.7.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^26.1.2","@types/aws-lambda":"^8.10.162"},"_npmOperationalInternal":{"tmp":"tmp/aws-lambda_0.7.1_1785734627151_0.6407365599171686","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.8.0":{"name":"@standardserver/aws-lambda","version":"0.8.0","license":"MIT","_id":"@standardserver/aws-lambda@0.8.0","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://standardserver.dev","dist":{"shasum":"aa6d2c6f9ed8ae5b602ac7c58ccbeda6fdfd33c4","tarball":"https://registry.npmjs.org/@standardserver/aws-lambda/-/aws-lambda-0.8.0.tgz","fileCount":6,"integrity":"sha512-5fa8KQ1mFNyu8qRfHSshe4ta4Qbv621qsDT/Sed/bWe0ZzrXMOCEtKE5wyEv/S3co7Vb0+u0pF1oIGtYf49iwA==","signatures":[{"sig":"MEUCIQCd1xOHJoUWn8NrDDR1YUOJFDfCx9xq8Kr8WbF+YMGdWQIgA6aeX7DJTpUvD9sFc8tu4nY3MpiGB0E3GL/3rRElaR0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@standardserver%2faws-lambda@0.8.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":42362},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json"},"scripts":{"build":"unbuild","type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73af2003-0422-4b29-a510-00d0e12c51c1"}},"repository":{"url":"git+https://github.com/middleapi/standardserver.git","type":"git","directory":"packages/aws-lambda"},"directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@standardserver/core":"0.8.0","@standardserver/node":"0.8.0","@standardserver/fetch":"0.8.0","@standardserver/shared":"0.8.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^26.1.2","@types/aws-lambda":"^8.10.162"},"_npmOperationalInternal":{"tmp":"tmp/aws-lambda_0.8.0_1786693978863_0.5122643687555124","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.8.1":{"name":"@standardserver/aws-lambda","version":"0.8.1","keywords":["standardserver","aws","lambda","aws-lambda","serverless","adapter","response-streaming","server","request","response","streaming","typescript"],"license":"MIT","_id":"@standardserver/aws-lambda@0.8.1","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://standardserver.dev","dist":{"shasum":"9fde46476a58dbc54845d9d3585bf3ea736ec24e","tarball":"https://registry.npmjs.org/@standardserver/aws-lambda/-/aws-lambda-0.8.1.tgz","fileCount":6,"integrity":"sha512-HoDkKgmKhktTFjRE3t8V7Psn4Rhhg/XFrODoMUucvEJ5sCJCtX9VBy5JQYOMZp14m3ZgIXLOdT77bqJ6zDeBGg==","signatures":[{"sig":"MEUCIQCdM6L7RCIcd36YBpFuIedVkv4COIEeFHbZ5s6r0sZ3NQIgKGrn68B31bpthMrtvMMbBPhy/xw/gjNrnFf43tqopzE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@standardserver%2faws-lambda@0.8.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":45179},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json"},"funding":["https://github.com/sponsors/dinwwwh","https://opencollective.com/middleapi"],"scripts":{"build":"unbuild","type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73af2003-0422-4b29-a510-00d0e12c51c1"}},"repository":{"url":"git+https://github.com/middleapi/standardserver.git","type":"git","directory":"packages/aws-lambda"},"description":"AWS Lambda adapter for Standard Server: transport-agnostic requests and responses with Lambda response streaming support","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@standardserver/core":"0.8.1","@standardserver/node":"0.8.1","@standardserver/fetch":"0.8.1","@standardserver/shared":"0.8.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^26.1.2","@types/aws-lambda":"^8.10.162"},"_npmOperationalInternal":{"tmp":"tmp/aws-lambda_0.8.1_1787717031470_0.2317006256293137","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.8.2":{"name":"@standardserver/aws-lambda","version":"0.8.2","keywords":["standardserver","aws","lambda","aws-lambda","serverless","adapter","response-streaming","server","request","response","streaming","typescript"],"license":"MIT","_id":"@standardserver/aws-lambda@0.8.2","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://standardserver.dev","dist":{"shasum":"9b7fb45580ea47eedc5ef29fb35d712d8c29ab18","tarball":"https://registry.npmjs.org/@standardserver/aws-lambda/-/aws-lambda-0.8.2.tgz","fileCount":6,"integrity":"sha512-7ALbEEgCKdywwwc0uLr1/ZcsqZ/rzCebhV2zZdXVkutfJzxOwwpXFysvA/Jbhnhi3HPBgRxApHuWxx3j5wgRhw==","signatures":[{"sig":"MEUCICygqy2tknX3y44/lkxpCuT/A0uVn9Kn5as1GQCQOjsAAiEAnX8VPAlUV9r2dG77WBzx23+lfbPBgLybaE/sbeqvbtA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@standardserver%2faws-lambda@0.8.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":45179},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json"},"funding":["https://github.com/sponsors/dinwwwh","https://opencollective.com/middleapi"],"scripts":{"build":"unbuild","type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73af2003-0422-4b29-a510-00d0e12c51c1"}},"repository":{"url":"git+https://github.com/middleapi/standardserver.git","type":"git","directory":"packages/aws-lambda"},"description":"AWS Lambda adapter for Standard Server: transport-agnostic requests and responses with Lambda response streaming support","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@standardserver/core":"0.8.2","@standardserver/node":"0.8.2","@standardserver/fetch":"0.8.2","@standardserver/shared":"0.8.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^26.1.2","@types/aws-lambda":"^8.10.162"},"_npmOperationalInternal":{"tmp":"tmp/aws-lambda_0.8.2_1787794792670_0.7463101412860909","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.8.3":{"name":"@standardserver/aws-lambda","version":"0.8.3","keywords":["standardserver","aws","lambda","aws-lambda","serverless","adapter","response-streaming","server","request","response","streaming","typescript"],"license":"MIT","_id":"@standardserver/aws-lambda@0.8.3","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://standardserver.dev","dist":{"shasum":"15131e8bc0fc674f2ea3ee531e578ca2b5b7c33b","tarball":"https://registry.npmjs.org/@standardserver/aws-lambda/-/aws-lambda-0.8.3.tgz","fileCount":6,"integrity":"sha512-QozxFyi5h8cmcAgTTfd7KoHjjsfXwoSBdWV64Ehffow4i9+Hv6lvezwhsVchQRPXDbY7f3WzN5MJ/uWwesObng==","signatures":[{"sig":"MEQCIBg+sedf1R860IFm5Vc9PGXFMF2bLxVH+ecF0/jQeQB1AiAL6yAhTKj7EpDlTi8hG0s1E2l7p5v0wCnLrd95/w5eNg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@standardserver%2faws-lambda@0.8.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46277},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json"},"funding":["https://github.com/sponsors/dinwwwh","https://opencollective.com/middleapi"],"scripts":{"build":"unbuild","type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73af2003-0422-4b29-a510-00d0e12c51c1"}},"repository":{"url":"git+https://github.com/middleapi/standardserver.git","type":"git","directory":"packages/aws-lambda"},"description":"AWS Lambda adapter for Standard Server: transport-agnostic requests and responses with Lambda response streaming support","directories":{},"sideEffects":false,"dependencies":{"@standardserver/core":"0.8.3","@standardserver/node":"0.8.3","@standardserver/fetch":"0.8.3","@standardserver/shared":"0.8.3"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^26.4.1","@types/aws-lambda":"^8.10.162"},"_npmOperationalInternal":{"tmp":"tmp/aws-lambda_0.8.3_1788597382633_0.10272742517490219","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2026-08-02T04:32:06.391Z","modified":"2026-09-06T08:39:00.399Z","0.6.0":"2026-08-02T04:32:06.790Z","0.7.0":"2026-08-03T03:13:10.747Z","0.7.1":"2026-08-03T05:23:47.283Z","0.8.0":"2026-08-14T07:52:59.015Z","0.8.1":"2026-08-26T04:03:51.620Z","0.8.2":"2026-08-27T01:39:52.822Z","0.8.3":"2026-09-05T08:36:22.774Z"},"license":"MIT","homepage":"https://standardserver.dev","keywords":["standardserver","aws","lambda","aws-lambda","serverless","adapter","response-streaming","server","request","response","streaming","typescript"],"repository":{"url":"git+https://github.com/middleapi/standardserver.git","type":"git","directory":"packages/aws-lambda"},"description":"AWS Lambda adapter for Standard Server: transport-agnostic requests and responses with Lambda response streaming support","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"readme":"# @standardserver/aws-lambda\n\n<div align=\"center\">\n  <a href=\"https://codecov.io/gh/middleapi/standardserver\">\n    <img alt=\"codecov\" src=\"https://codecov.io/gh/middleapi/standardserver/branch/main/graph/badge.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/@standardserver/aws-lambda\">\n    <img alt=\"weekly downloads\" src=\"https://img.shields.io/npm/dw/%40standardserver%2Faws-lambda?logo=npm\" />\n  </a>\n  <a href=\"https://app.codspeed.io/middleapi/standardserver?utm_source=badge\">\n    <img src=\"https://img.shields.io/endpoint?url=https://codspeed.io/badge.json\" alt=\"CodSpeed\" />\n  </a>\n  <a href=\"https://github.com/middleapi/standardserver/blob/main/LICENSE\">\n    <img alt=\"MIT License\" src=\"https://img.shields.io/github/license/middleapi/standardserver?logo=open-source-initiative\" />\n  </a>\n  <a href=\"https://discord.gg/TXEbwRBvQn\">\n    <img alt=\"Discord\" src=\"https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff\" />\n  </a>\n  <a href=\"https://deepwiki.com/middleapi/standardserver\">\n    <img src=\"https://deepwiki.com/badge.svg\" alt=\"Ask DeepWiki\">\n  </a>\n</div>\n\n`@standardserver/aws-lambda` adapts AWS Lambda events and response streams to the transport-agnostic request and response model defined by Standard Server.\n\nStandard Server provides a unified interface for client-server communication across HTTP and message-based transports. It lets you write handlers against the same request, response, body, and streaming primitives whether the underlying transport is the Fetch API, Node.js HTTP, HTTP/2, or a peer-style message channel.\n\nStandard Server ships as a small ecosystem of packages:\n\n| Package                                                                                                             | Description                                                                 |\n| ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |\n| [`@standardserver/core`](https://github.com/middleapi/standardserver/blob/main/packages/core/README.md)             | The shared contract: types, body parsing rules, validators, and SSE helpers |\n| [`@standardserver/fetch`](https://github.com/middleapi/standardserver/blob/main/packages/fetch/README.md)           | Fetch API adapter for browsers, workers, and other Fetch-based runtimes     |\n| [`@standardserver/node`](https://github.com/middleapi/standardserver/blob/main/packages/node/README.md)             | Node.js HTTP and HTTP/2 adapter                                             |\n| [`@standardserver/fastify`](https://github.com/middleapi/standardserver/blob/main/packages/fastify/README.md)       | Fastify adapter built on the Node.js adapter                                |\n| [`@standardserver/aws-lambda`](https://github.com/middleapi/standardserver/blob/main/packages/aws-lambda/README.md) | AWS Lambda adapter with response streaming                                  |\n| [`@standardserver/peer`](https://github.com/middleapi/standardserver/blob/main/packages/peer/README.md)             | Message-based adapter for WebSocket, MessagePort, and custom transports     |\n| [`@standardserver/shared`](https://github.com/middleapi/standardserver/blob/main/packages/shared/README.md)         | Internal utilities shared across the ecosystem                              |\n\nThis package is the AWS Lambda adapter for that model. It converts an API Gateway proxy event — payload format version 1.0 or 2.0, the latter also used by Lambda Function URLs — into a `StandardLazyRequest`, and writes a `StandardResponse` back through the stream provided by `awslambda.streamifyResponse`, so streaming bodies such as server-sent events flow to the client as they are produced instead of being buffered.\n\n## Package overview\n\nThe package exposes these helpers:\n\n| Group                   | Exports                                                                                                                                             | Purpose                                                     |\n| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |\n| Request and response    | `toStandardLazyRequest()`, `sendStandardResponse()`                                                                                                 | Adapt Lambda events and response streams to Standard Server |\n| Lower-level helpers     | `toStandardUrl()`, `toStandardHeaders()`, `getEventHeader()`, `toStandardBody()`, `toLambdaHeaders()`                                               | Convert individual pieces of an event                       |\n| Types and option shapes | `APIGatewayProxyEvent`, `APIGatewayProxyEventV2`, `AnyAPIGatewayProxyEvent`, `HttpResponseStream`, `AwsLambdaGlobal`, `SendStandardResponseOptions` | Type handler inputs and serializer options                  |\n\n`APIGatewayProxyEvent` and `APIGatewayProxyEventV2` are structural subsets of the same-named types from `@types/aws-lambda`, so events typed with either work; the adapter accepts both via `AnyAPIGatewayProxyEvent` and tells them apart by the top-level `httpMethod` field only payload format 1.0 carries. `AwsLambdaGlobal` describes the `awslambda` global the Lambda Node.js runtime injects — the package deliberately does not `declare global`, so importing it never pollutes your project's global types. Declare the global yourself where you need typed access to `awslambda.streamifyResponse`.\n\n## Server-side request handling\n\nUse `toStandardLazyRequest()` to convert the incoming event into a `StandardLazyRequest`, then `sendStandardResponse()` to write the resulting `StandardResponse` back through the response stream. The handler must be wrapped with `awslambda.streamifyResponse`, and the function must run on the AWS Lambda Node.js runtime with response streaming enabled.\n\n```ts\nimport type { AwsLambdaGlobal } from '@standardserver/aws-lambda'\nimport type { StandardLazyRequest, StandardResponse } from '@standardserver/core'\nimport { sendStandardResponse, toStandardLazyRequest } from '@standardserver/aws-lambda'\n\n// injected by the AWS Lambda Node.js runtime when response streaming is enabled\ndeclare const awslambda: AwsLambdaGlobal\n\nasync function handle(request: StandardLazyRequest): Promise<StandardResponse> {\n  const body = await request.resolveBody()\n\n  return {\n    status: 200,\n    headers: { 'content-type': 'application/json' },\n    body: {\n      ok: true,\n      method: request.method,\n      url: request.url,\n      received: body,\n    },\n  }\n}\n\nexport const handler = awslambda.streamifyResponse(async (event, responseStream, context) => {\n  const standardRequest = toStandardLazyRequest(event, responseStream)\n  const standardResponse = await handle(standardRequest)\n\n  await sendStandardResponse(responseStream, standardResponse, {/** options */})\n})\n```\n\n`sendStandardResponse()` sends the status, headers, and cookies as the response stream metadata prelude via `awslambda.HttpResponseStream.from()`, then streams the body. It resolves once the response is fully flushed, and rejects if the stream errors.\n\n> [!TIP]\n> When sending responses, you can pass additional options such as event-stream keep-alive.\n\n## Resolving Body\n\nThe event carries the request body as a fully buffered, optionally base64-encoded string. `resolveBody(hint?)` decodes it and then follows the shared Standard Server resolution rules: an explicit `hint` wins, then the [`standard-server` header](https://github.com/middleapi/standardserver/blob/main/packages/core/README.md#the-standard-server-header), then inference from the content headers. See [how body parsing works](https://github.com/middleapi/standardserver/blob/main/packages/core/README.md#how-body-parsing-works) in the core README for the full algorithm.\n\n> [!TIP]\n> For efficient communication, set the `standard-server` header to explicitly hint the body type, especially for file or binary streaming. For example, if you upload a file with a common `content-type` such as `application/json` but omit the `standard-server` header, the server may interpret it as JSON and parse it unexpectedly.\n\n## Lambda behavior to be aware of\n\n- **Response streaming must be enabled.** `sendStandardResponse()` relies on the `awslambda` global, which only exists on the AWS Lambda Node.js runtime, and on the metadata prelude of `awslambda.HttpResponseStream`, which the platform only interprets for streaming-enabled invocations.\n- **`set-cookie` is sent via metadata cookies.** Multiple cookies survive because they are sent through the dedicated `cookies` metadata field; every other multi-value header is joined with `, `.\n- **Request bodies are buffered.** API Gateway delivers the whole request body at once, so request-side streaming degrades to a single buffered chunk. Response-side streaming is real streaming.\n- **Payload format 1.0 query strings are re-encoded.** API Gateway delivers them url-decoded, so the adapter re-encodes them when reconstructing the standard url. Payload format 2.0 provides the already encoded `rawQueryString`, which is used as-is.\n- **Payload format 2.0 cookies are restored.** API Gateway strips the `cookie` header into the separate `cookies` field, and the adapter joins them back into a `cookie` header on the standard request.\n\n## Learn more\n\nFor the project overview and the shared contract, see the [core documentation](https://github.com/middleapi/standardserver/blob/main/packages/core/README.md). For the Node.js primitives this adapter is built on, see the [Node.js adapter documentation](https://github.com/middleapi/standardserver/blob/main/packages/node/README.md).\n\n## Sponsors\n\nLike what we build over at [middleapi](https://github.com/middleapi)? You can help keep it going through [GitHub Sponsors](https://github.com/sponsors/dinwwwh) or [Open Collective](https://opencollective.com/middleapi). Every bit helps! 🚀\n\n<table>\n  <tr>\n   <td width=\"2000\"><a href=\"https://screenshotone.com/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener\" title=\"The screenshot API for developers\"><img src=\"https://avatars.githubusercontent.com/u/97035603?v=4\" width=\"64\" align=\"left\" hspace=\"12\" alt=\"ScreenshotOne.com\"/><b>ScreenshotOne.com</b></a><br /><sub>The screenshot API for developers</sub></td>\n  </tr>\n  <tr>\n   <td width=\"2000\"><a href=\"https://yuzu.health/careers?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"We&#39;re hiring NYC based engineers\"><img src=\"https://avatars.githubusercontent.com/u/102488956?v=4\" width=\"64\" align=\"left\" hspace=\"12\" alt=\"Yuzu\"/><b>Yuzu</b></a><br /><sub>We&#39;re hiring NYC based engineers</sub></td>\n  </tr>\n  <tr>\n   <td width=\"2000\"><a href=\"https://misskey.io/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Decentralized microblogging SNS born on Earth\"><img src=\"https://github.com/MisskeyIO.png\" width=\"64\" align=\"left\" hspace=\"12\" alt=\"MisskeyHQ\"/><b>MisskeyHQ</b></a><br /><sub>Decentralized microblogging SNS born on Earth</sub></td>\n  </tr>\n</table>\n\n### Organization Sponsors\n\n<table>\n  <tr>\n   <td align=\"center\"><a href=\"https://lnmarkets.com/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"LN Markets\"><img src=\"https://avatars.githubusercontent.com/u/70597625?v=4\" width=\"167\" alt=\"LN Markets\"/><br />LN Markets</a></td>\n  </tr>\n</table>\n\n### Sponsors\n\n<table>\n  <tr>\n   <td align=\"center\"><a href=\"https://github.com/hrmcdonald?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Reece McDonald\"><img src=\"https://avatars.githubusercontent.com/u/39349270?v=4\" width=\"139\" alt=\"Reece McDonald\"/><br />Reece McDonald</a></td>\n   <td align=\"center\"><a href=\"https://soymilk.party/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"あわわわとーにゅ\"><img src=\"https://avatars.githubusercontent.com/u/17376330?u=de3353804be889f009f7e0a1582daf04d0ab292d&amp;v=4\" width=\"139\" alt=\"あわわわとーにゅ\"/><br />あわわわとーにゅ</a></td>\n   <td align=\"center\"><a href=\"https://github.com/nicognaW?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"nk\"><img src=\"https://avatars.githubusercontent.com/u/66731869?u=4699bda3a9092d3ec34fbd959450767bcc8b8b6d&amp;v=4\" width=\"139\" alt=\"nk\"/><br />nk</a></td>\n   <td align=\"center\"><a href=\"https://supastarter.dev/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"supastarter\"><img src=\"https://avatars.githubusercontent.com/u/110960143?v=4\" width=\"139\" alt=\"supastarter\"/><br />supastarter</a></td>\n   <td align=\"center\"><a href=\"https://github.com/divmgl?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Dexter Miguel\"><img src=\"https://avatars.githubusercontent.com/u/5452298?u=645993204be8696c085ecf0d228c3062efe2ed65&amp;v=4\" width=\"139\" alt=\"Dexter Miguel\"/><br />Dexter Miguel</a></td>\n   <td align=\"center\"><a href=\"https://github.com/herrfugbaum?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"herrfugbaum\"><img src=\"https://avatars.githubusercontent.com/u/12859776?u=644dc1666d0220bc0468eb0de3c56b919f635b16&amp;v=4\" width=\"139\" alt=\"herrfugbaum\"/><br />herrfugbaum</a></td>\n  </tr>\n  <tr>\n   <td align=\"center\"><a href=\"https://laststance.io/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Ryota Murakami\"><img src=\"https://avatars.githubusercontent.com/u/5501268?u=599389e03340734325726ca3f8f423c021d47d7f&amp;v=4\" width=\"139\" alt=\"Ryota Murakami\"/><br />Ryota Murakami</a></td>\n   <td align=\"center\"><a href=\"https://cra.mr/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"David Cramer\"><img src=\"https://avatars.githubusercontent.com/u/23610?v=4\" width=\"139\" alt=\"David Cramer\"/><br />David Cramer</a></td>\n   <td align=\"center\"><a href=\"https://valerii15298.github.io/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Valerii Petryniak\"><img src=\"https://avatars.githubusercontent.com/u/44531564?u=88ac74d9bacd20401518441907acad21063cd397&amp;v=4\" width=\"139\" alt=\"Valerii Petryniak\"/><br />Valerii Petryniak</a></td>\n   <td align=\"center\"><a href=\"https://letstri.dev/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Valerii Strilets\"><img src=\"https://avatars.githubusercontent.com/u/13253748?u=c7b10399ccc8f8081e24db94ec32cd9858e86ac3&amp;v=4\" width=\"139\" alt=\"Valerii Strilets\"/><br />Valerii Strilets</a></td>\n   <td align=\"center\"><a href=\"https://blacklight.sh/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Kyle Mistele\"><img src=\"https://avatars.githubusercontent.com/u/18430555?u=3afebeb81de666e35aaac3ed46f14159d7603ffb&amp;v=4\" width=\"139\" alt=\"Kyle Mistele\"/><br />Kyle Mistele</a></td>\n   <td align=\"center\"><a href=\"https://github.com/christ12938?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"christ12938\"><img src=\"https://avatars.githubusercontent.com/u/25758598?v=4\" width=\"139\" alt=\"christ12938\"/><br />christ12938</a></td>\n  </tr>\n  <tr>\n   <td align=\"center\"><a href=\"https://github.com/Ryanjso?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Ryan Soderberg\"><img src=\"https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&amp;v=4\" width=\"139\" alt=\"Ryan Soderberg\"/><br />Ryan Soderberg</a></td>\n   <td align=\"center\"><a href=\"https://github.com/itigoore01?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"shota\"><img src=\"https://avatars.githubusercontent.com/u/11831107?u=c976a6dc7e055eb026304c46c99100ed22b0c8e0&amp;v=4\" width=\"139\" alt=\"shota\"/><br />shota</a></td>\n   <td align=\"center\"><a href=\"https://github.com/ellis-driscoll?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Ellis Driscoll\"><img src=\"https://avatars.githubusercontent.com/u/70685966?u=c5f95bc33b5991d9744abe00052542e4a2ed3cb9&amp;v=4\" width=\"139\" alt=\"Ellis Driscoll\"/><br />Ellis Driscoll</a></td>\n   <td align=\"center\"><a href=\"https://github.com/hoangbn?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Hoang Nguyen\"><img src=\"https://avatars.githubusercontent.com/u/38968280?u=c90084c6de65c56facabab7ba13a72a49ddbc3e4&amp;v=4\" width=\"139\" alt=\"Hoang Nguyen\"/><br />Hoang Nguyen</a></td>\n   <td align=\"center\"><a href=\"https://opencollective.com/guest-ac41de3b?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Orestis Ioannou\"><img src=\"https://images.opencollective.com/guest-ac41de3b/avatar/460.png\" width=\"139\" alt=\"Orestis Ioannou\"/><br />Orestis Ioannou</a></td>\n  </tr>\n</table>\n\n### Backers\n\n<table>\n  <tr>\n   <td align=\"center\"><a href=\"https://github.com/rhinodavid?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"David Walsh\"><img src=\"https://avatars.githubusercontent.com/u/5778036?u=b5521f07d2f88c3db2a0dae62b5f2f8357214af0&amp;v=4\" width=\"119\" alt=\"David Walsh\"/><br />David Walsh</a></td>\n   <td align=\"center\"><a href=\"https://github.com/IPv4Addr?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"IPv4Addr\"><img src=\"https://avatars.githubusercontent.com/u/100147665?u=59996b72f69bb53063cb7e9ff8b8f898616cd94d&amp;v=4\" width=\"119\" alt=\"IPv4Addr\"/><br />IPv4Addr</a></td>\n   <td align=\"center\"><a href=\"https://robbevaes.be/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Robbe Vaes\"><img src=\"https://avatars.githubusercontent.com/u/44748019?u=e0232402c045ad4eac7cbd217f1f47e083103b89&amp;v=4\" width=\"119\" alt=\"Robbe Vaes\"/><br />Robbe Vaes</a></td>\n   <td align=\"center\"><a href=\"https://github.com/aidansunbury?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Aidan Sunbury\"><img src=\"https://avatars.githubusercontent.com/u/64103161?v=4\" width=\"119\" alt=\"Aidan Sunbury\"/><br />Aidan Sunbury</a></td>\n   <td align=\"center\"><a href=\"https://github.com/soonoo?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"soonoo\"><img src=\"https://avatars.githubusercontent.com/u/5436405?u=5d0b4aa955c87e30e6bda7f0cccae5402da99528&amp;v=4\" width=\"119\" alt=\"soonoo\"/><br />soonoo</a></td>\n   <td align=\"center\"><a href=\"https://kevinporten.dev/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Kevin Porten\"><img src=\"https://avatars.githubusercontent.com/u/1839345?u=dc2263d5cfe0d927ce1a0be04a1d55dd6b55405c&amp;v=4\" width=\"119\" alt=\"Kevin Porten\"/><br />Kevin Porten</a></td>\n   <td align=\"center\"><a href=\"https://github.com/pumpkinlink?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Denis\"><img src=\"https://avatars.githubusercontent.com/u/11864620?u=5f47bbe6c65d0f6f5cf011021490238e4b0593d0&amp;v=4\" width=\"119\" alt=\"Denis\"/><br />Denis</a></td>\n  </tr>\n  <tr>\n   <td align=\"center\"><a href=\"https://github.com/christopher-kapic?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Christopher Kapic\"><img src=\"https://avatars.githubusercontent.com/u/59740769?u=e7ad4b72b5bf6c9eb1644c26dbf3332a8f987377&amp;v=4\" width=\"119\" alt=\"Christopher Kapic\"/><br />Christopher Kapic</a></td>\n   <td align=\"center\"><a href=\"http://ballingt.com/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Tom Ballinger\"><img src=\"https://avatars.githubusercontent.com/u/458879?u=4b045ac75d721b6ac2b42a74d7d37f61f0414031&amp;v=4\" width=\"119\" alt=\"Tom Ballinger\"/><br />Tom Ballinger</a></td>\n   <td align=\"center\"><a href=\"https://lee-sam.com/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Sam\"><img src=\"https://avatars.githubusercontent.com/u/102863520?u=3c89611f549d5070be232eb4532f690c8f2e7a65&amp;v=4\" width=\"119\" alt=\"Sam\"/><br />Sam</a></td>\n   <td align=\"center\"><a href=\"https://github.com/Titoine?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Titoine\"><img src=\"https://avatars.githubusercontent.com/u/3514286?u=1bb1e86b0c99c8a1121372e56d51a177eea12191&amp;v=4\" width=\"119\" alt=\"Titoine\"/><br />Titoine</a></td>\n   <td align=\"center\"><a href=\"https://rigtch.fm/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Igor Makowski\"><img src=\"https://avatars.githubusercontent.com/u/56691628?u=ee8c879478f7c151b9156aef6c74243fa3e247a8&amp;v=4\" width=\"119\" alt=\"Igor Makowski\"/><br />Igor Makowski</a></td>\n   <td align=\"center\"><a href=\"https://blog.cwang.io/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"hanayashiki\"><img src=\"https://avatars.githubusercontent.com/u/26056783?u=06c3b9205a16fd41a871e82da1cc2a09306d53f5&amp;v=4\" width=\"119\" alt=\"hanayashiki\"/><br />hanayashiki</a></td>\n   <td align=\"center\"><a href=\"https://dubinets.io/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Lev Dubinets\"><img src=\"https://avatars.githubusercontent.com/u/3114081?u=f547f5d5012cab54851f1b1ad72d10e537f78fc2&amp;v=4\" width=\"119\" alt=\"Lev Dubinets\"/><br />Lev Dubinets</a></td>\n  </tr>\n  <tr>\n   <td align=\"center\"><a href=\"https://kellychan.im/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Kelly Peilin Chan\"><img src=\"https://avatars.githubusercontent.com/u/520852?u=6b0f7105f694e7b5cacf410a3f04c7044b469dc8&amp;v=4\" width=\"119\" alt=\"Kelly Peilin Chan\"/><br />Kelly Peilin Chan</a></td>\n   <td align=\"center\"><a href=\"https://guyariely.com/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Guy Ariely\"><img src=\"https://avatars.githubusercontent.com/u/42813496?u=edb6b7f563bf28e160a290832e7da57c0506f8ca&amp;v=4\" width=\"119\" alt=\"Guy Ariely\"/><br />Guy Ariely</a></td>\n   <td align=\"center\"><a href=\"https://paulsenon.com/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"PaulSenon\"><img src=\"https://avatars.githubusercontent.com/u/19531087?u=6385741eb91d200b8c513ec6045482e301767ca6&amp;v=4\" width=\"119\" alt=\"PaulSenon\"/><br />PaulSenon</a></td>\n   <td align=\"center\"><a href=\"https://piscis.dev/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Alex\"><img src=\"https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&amp;v=4\" width=\"119\" alt=\"Alex\"/><br />Alex</a></td>\n   <td align=\"center\"><a href=\"https://opensource.gubanov.eu/?ref=middleapi&amp;utm_source=middleapi&amp;utm_medium=sponsor\" target=\"_blank\" rel=\"noopener sponsored\" title=\"Andrey Gubanov\"><img src=\"https://avatars.githubusercontent.com/u/1082083?u=c5f2daf7ebece498e85c83367bb37b4e10e2649d&amp;v=4\" width=\"119\" alt=\"Andrey Gubanov\"/><br />Andrey Gubanov</a></td>\n  </tr>\n</table>\n\nWith thanks to [36 past sponsors](https://htmlpreview.github.io/?https://github.com/middleapi/static/blob/main/sponsors.svg) who helped get us here.\n\n## License\n\nDistributed under the MIT License. See [LICENCE](https://github.com/middleapi/standardserver/blob/main/LICENCE) for more information.\n","readmeFilename":""}