Skip to content

remix/file-storage/s3 · Interface

View Source

S3FileStorageOptions

Summary

Configuration for an S3-backed FileStorage implementation.

Signature

interface S3FileStorageOptions {
  accessKeyId: string
  bucket: string
  endpoint?: string
  fetch?: {
    (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
    (input: string | Request | URL, init?: RequestInit): Promise<Response>
  }
  forcePathStyle?: boolean
  partSize?: number
  region: string
  secretAccessKey: string
  sessionToken?: string
}

Properties

accessKeyId

AWS access key ID used to sign S3 requests.

bucket

Bucket name used for all file storage operations.

endpoint

Custom S3-compatible endpoint URL. Defaults to AWS S3 for the given region.

fetch

Optional fetch implementation.

forcePathStyle

Whether to use path-style bucket URLs (/bucket/key). Defaults to true when endpoint is provided and false otherwise.

partSize

Size in bytes of each part when a file is larger than one part and is sent with a multipart upload. At most two parts are held in memory per upload. Must be at least 5 MiB, the S3 minimum. Defaults to 8 MiB.

region

AWS region for request signing.

secretAccessKey

AWS secret access key used to sign S3 requests.

sessionToken

Optional session token for temporary credentials.