S3 Storage Plugin
The @codesordinatestudio/radiant-plugin-s3 plugin provides an S3-compatible storage adapter for Radiant. It leverages Bun's native Bun.S3Client for maximum performance without heavy third-party dependencies.
Installation
bun add @codesordinatestudio/radiant-plugin-s3
Usage
Configure the plugin in your radiant.config.ts:
import { radiant } from "@codesordinatestudio/radiant-bun";
import { s3Storage } from "@codesordinatestudio/radiant-plugin-s3";
const app = radiant({
storage: s3Storage({
bucket: "my-bucket",
region: "us-east-1",
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
// Optional configuration for S3-compatible providers (Cloudflare R2, MinIO, etc.)
// endpoint: "https://<account-id>.r2.cloudflarestorage.com",
// publicUrl: "https://my-custom-domain.com",
// forcePathStyle: true,
}),
});
Once configured, any files uploaded to your collections (via file or image fields) will be automatically routed and saved to this S3 bucket, and their public URLs will be stored in your database.