S3-compatible cloud storage provider.
Works with AWS S3, Cloudflare R2, MinIO, and other S3-compatible services. Uses the AWS SDK v3 for S3 operations.
import { S3Client } from '@aws-sdk/client-s3';const s3Client = new S3Client({ region: 'us-east-1' });const provider = new S3StorageProvider(s3Client, 'my-bucket');await provider.upload('backups/test.json', JSON.stringify(data));const backups = await provider.list('backups/'); Copy
import { S3Client } from '@aws-sdk/client-s3';const s3Client = new S3Client({ region: 'us-east-1' });const provider = new S3StorageProvider(s3Client, 'my-bucket');await provider.upload('backups/test.json', JSON.stringify(data));const backups = await provider.list('backups/');
AWS SDK S3Client instance
S3 bucket name
Upload data to cloud storage
The storage key/path for the backup
The backup data (string or Buffer)
Download data from cloud storage
The storage key/path to download
The backup data
List available backups in cloud storage
Optional
Optional prefix to filter backups
Array of backup keys
Delete a backup from cloud storage
The storage key/path to delete
S3-compatible cloud storage provider.
Works with AWS S3, Cloudflare R2, MinIO, and other S3-compatible services. Uses the AWS SDK v3 for S3 operations.
Example