Keywords: sveltekit, adapter, aws lambda, cloudfront, s3, cdk construct, SvelteKit, node runtime, bun runtime, response streaming, function url, toDefaultOrigin, basicHttpAuthentication, lambda warmer, getAwsEvent, getAwsContext
This documentation is published inside the installed package and matches the installed version. Prefer it over prior knowledge or older examples found online.
Full source and examples: https://github.com/BeeSolve/kit-on-lambda/tree/main
kit-on-lambda is a SvelteKit adapter plus a CDK construct that deploys a SvelteKit app
to AWS Lambda (Node.js or Bun runtime) behind CloudFront, with static assets on S3. The
package exposes three entry points: the default esbuild/Node adapter, kit-on-lambda/bun
(the Bun adapter), and kit-on-lambda/cdk (the SvelteKit construct).
| Guide | Description |
|---|---|
| Getting Started | Wire the adapter into vite.config.ts and deploy with the SvelteKit CDK construct |
| Custom Origins | Override the default CloudFront origin via toDefaultOrigin (e.g. HTTP API Gateway) |
The examples/ directory contains runnable SvelteKit apps and deployable CDK stacks:
| Example | What it shows |
|---|---|
| examples/basic | Minimal SvelteKit app built for all three adapter/runtime options |
| examples/streaming | Response streaming on the Bun runtime |
| examples/observability | OpenTelemetry tracing |
| examples/infra | CDK stacks wiring the SvelteKit construct for each build/runtime combination |
- README - the three build/run options, local development, asset paths, custom origins, observability, and troubleshooting
- CHANGELOG - version history
- Architecture Decision Records (GitHub only)