S3 client

GitHub

Configurable S3 client that signs uploads for FilesConnector and provides upload, download, deletion, and streaming operations.

Installation

bash
pnpm dlx shadcn@latest add @cs/s3-client

Usage

tsx
import { S3Client } from "@/lib/cs/s3-client"
tsx
const s3Client = new S3Client({
  bucket: process.env.S3_BUCKET ?? null,
  endpoint: process.env.S3_ENDPOINT ?? null,
  accessKeyId: process.env.S3_ACCESS_KEY_ID ?? null,
  secretAccessKey: process.env.S3_SECRET_ACCESS_KEY ?? null,
})