makeS3StorageService
const
makeS3StorageService:Effect
<StorageService
,ConfigError
,never
>
Defined in: packages/core/src/utils.ts:113
Creates an S3-compatible storage service instance configured for Cloudflare R2. Reads configuration from environment variables and initializes an S3 client.
Returns
Section titled “Returns”An Effect that produces a StorageService implementation
Throws
Section titled “Throws”Error if required environment variables are missing
Remarks
Section titled “Remarks”Required environment variables:
- S3_ACCOUNT_ID: Cloudflare account ID
- S3_ACCESS_KEY_ID: Access key for R2 storage
- S3_SECRET_ACCESS_KEY: Secret key for R2 storage
Example
Section titled “Example”const service = yield* makeS3StorageService;yield* service.upload("my-bucket", "file.txt", fileData);