$ show humanmade/tachyon
Tachyon is a production-grade serverless image resizing service built on AWS Lambda and S3. It takes HTTP requests that specify a path to an S3 object and query parameters (width, height, crop, quality, format, etc.), fetches the original image from S3 using the AWS SDK v3, resizes/transcodes it in-memory using the Sharp library (with support for animated GIF/WebP/PNG and smart cropping via smartcrop-sharp), and streams the result back to the client with appropriate cache headers. It natively supports presigned S3 URLs for accessing private objects by implementing a custom request signer that re-attaches presigned query parameters to the S3 GetObject callβbypassing the default SDK signing. The function is designed to be deployed as a single Lambda behind a Function URL (response streaming) or API Gateway, and includes a local development server for testing. While its primary use case is WordPress media handling (as part of the Human Made ecosystem), the core resizing and S3-fetching logic is framework-agnostic and could be adapted to any serverless image processing pipeline.
The LLM identified 1 files worth highlighting for reuse:
The `getS3File` function in `lib.ts` implements a custom S3 request signer that allows the Lambda to transparently use pre-signed URL query parameters (X-Amz-Algorithm, X-Amz-Credential, etc.) passed by the caller to fetch private objects from S3. It overrides the default SDK v3 signing behavior by providing a `signer` configuration option that selectively includes only the presigned headers and query parameters, effectively re-signing the request with the caller's temporary credentials. This is a non-trivial workaround for a common serverless pattern (Lambda as a proxy for private S3 content) and can be extracted into a reusable middleware or standalone module for any SDK v3 service that needs to preserve an externally-generated signature.