MCPcopy Index your code
hub / github.com/simstudioai/sim / getS3Client

Function getS3Client

apps/sim/lib/uploads/providers/s3/client.ts:45–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43}
44
45export function getS3Client(): S3Client {
46 if (_s3Client) return _s3Client
47
48 const { region } = S3_CONFIG
49
50 if (!region) {
51 throw new Error(
52 'AWS region is missing – set AWS_REGION in your environment or disable S3 uploads.'
53 )
54 }
55
56 _s3Client = new S3Client({
57 region,
58 endpoint: S3_CONFIG.endpoint,
59 forcePathStyle: S3_CONFIG.forcePathStyle,
60 credentials: getAwsCredentialsFromEnv(),
61 })
62
63 return _s3Client
64}
65
66/**
67 * Upload a file to S3

Callers 15

client.test.tsFile · 0.90
uploadToS3Function · 0.85
getPresignedUrlFunction · 0.85
downloadFromS3Function · 0.85
downloadFromS3StreamFunction · 0.85
headS3ObjectFunction · 0.85
deleteFromS3Function · 0.85
deleteManyFromS3Function · 0.85
uploadS3PartFunction · 0.85
getS3MultipartPartUrlsFunction · 0.85

Calls 1

getAwsCredentialsFromEnvFunction · 0.90

Tested by

no test coverage detected