The storage client provides a full-featured S3-compatible API that works with both AWS S3 (production) and MinIO (local dev). It auto-detects the environment.
Create a storage client with explicit configuration.
import { createStorageClient } from ' @venturekit/storage ' ;
const storage = createStorageClient ( {
prefix: ' tenant-123/ ' , // optional key prefix
Config options:
Option Type Description bucketstringS3 bucket name (required) regionstringAWS region (default: AWS_REGION env var) endpointstringCustom S3 endpoint (auto-set for MinIO locally) forcePathStylebooleanForce path-style URLs (auto-set for MinIO) prefixstringKey prefix for all operations credentialsobjectAWS credentials (uses default chain if omitted)
Create a storage client from environment variables. Reads VENTURE_STORAGE_BUCKET, VENTURE_STORAGE_PREFIX, and MinIO config from env.
import { createStorageClientFromEnv } from ' @venturekit/storage ' ;
const storage = createStorageClientFromEnv ();
Method Description put(key, body, options?)Upload data (Buffer, string, or stream) get(key, options?)Download data as Buffer getStream(key, options?)Download data as readable stream head(key)Get object metadata without downloading delete(key)Delete an object deleteMany(keys)Delete multiple objects copy(src, dest, options?)Copy an object move(src, dest, options?)Move an object (copy + delete) list(options?)List objects (paginated) listAll(options?)List all objects (auto-paginate) exists(key)Check if an object exists getSignedUrl(key, options?)Get a signed download URL getSignedUploadUrl(key, options?)Get a signed upload URL upload(key, body, options?)Multipart upload for large files
Option Type Description contentTypestringMIME content type cacheControlstringCache control header metadataRecord<string, string>Custom metadata storageClassstringStorage class (STANDARD, GLACIER, etc.) encryption'AES256' | 'aws:kms'Server-side encryption tagsRecord<string, string>Object tags
Option Type Description expiresInnumberExpiration in seconds (default: 3600) responseContentTypestringOverride response content type responseContentDispositionstringOverride content disposition
Function Description createS3Config(options)Create S3 bucket configuration buildS3Config(config)Build S3 infrastructure config
Constant Description DEFAULT_S3_CONFIGDefault S3 configuration
Type Description StorageClientThe storage client interface StorageClientConfigClient configuration PutOptionsUpload options GetResultDownload result (body + metadata) GetStreamResultStream download result HeadResultMetadata-only result ListResultList result with pagination ObjectInfoObject metadata in list results SignedUrlOptionsSigned download URL options SignedUploadUrlOptionsSigned upload URL options S3OutputsS3 deployment outputs S3InfraConfigS3 infrastructure configuration