Home > database >  How Do I Access S3 Bucket Files in Browser Using AccessKeyId and SecretAccessKey?
How Do I Access S3 Bucket Files in Browser Using AccessKeyId and SecretAccessKey?

Time:11-30

I have accessKeyId and secretAccessKey for AWS S3 bucket. How do I access the video files on the bucket using the browser?

I'm using React and Node(Nest.js). I would like to play the video files on the React Frontend

CodePudding user response:

If your web page has AWS credentials, then you can use the AWS JavaScript SDK in the browser to create a pre-signed URL for the video file in S3, then provide that URL to your video player.

If the web page doesn't have AWS credentials and can't easily get them, then consider using AWS Amplify or write a small server-side component to do this on behalf of your client.

Note that pre-signed URLs have an associated expiration date/time.

  • Related