Skip to main content

S3

Server Source code Package

S3-compatible object storage store using s3mini (~20 KB, zero dependencies). Works with AWS S3, Cloudflare R2, Scaleway, DigitalOcean Spaces, Backblaze B2, MinIO, and any S3-compatible provider.

Setup

Install the package:

Loading...

Configure in your code:

Loading...

Configuration

PropertyTypeDescriptionMore
bucket*stringS3 bucket name
endpoint*stringS3-compatible endpoint URL
accessKeyId*stringS3 access key ID
secretAccessKey*stringS3 secret access key
region*stringAWS region for SigV4 signing
prefixstringKey prefix prepended to all store keys for scoping
* Required fields

Provider examples

ProviderEndpointNotes
AWS S3https://s3.<region>.amazonaws.comSet region to your actual region
Cloudflare R2https://<account>.r2.cloudflarestorage.comNo egress fees
Scalewayhttps://s3.<region>.scw.cloudEU hosting
DigitalOceanhttps://<region>.digitaloceanspaces.comSimple pricing
Backblaze B2https://s3.<region>.backblazeb2.comCheapest storage
MinIOhttp://localhost:9000Self-hosted

Credentials

Use $env. references in Flow.Config to avoid hardcoding secrets:

Loading...

Unlike the AWS SDK, s3mini has no implicit credential chain: accessKeyId and secretAccessKey are always required.

File serving pattern

The primary use case is serving static files via the file transformer. This is the recommended pattern for managed deployments (Mode D) where files live in a bucket rather than needing to be baked into a Docker image:

Loading...

A request to /static/walker.js looks up public/walker.js in the my-assets bucket.

Security

  • Key validation: Path traversal attempts (.., absolute paths) are rejected
  • Prefix scoping: The prefix setting restricts all operations to a subdirectory
  • No credential chain: Credentials must be explicitly provided (no ambient AWS credentials)

API

Loading...

get() returns Buffer for compatibility with the file transformer, which uses content instanceof Buffer for Content-Length calculation.

💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)