How to use @aws-sdk/s3-request-presigner - 1 common examples

To help you get started, we’ve selected a few @aws-sdk/s3-request-presigner examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-samples / aws-sdk-js-v3-workshop / Exercise2 / frontend / src / libs / getObjectUrl.ts View on Github external
const getObjectUrl = async (fileName: string) => {
  const request = await createRequest(
    s3Client,
    new GetObjectCommand({
      Key: fileName,
      Bucket: config.s3Bucket
    })
  );

  const signer = new S3RequestPresigner({
    ...s3Client.config
  });

  const url = await signer.presignRequest(
    request,
    new Date(Date.now() + 60 * 60 * 1000)
  );
  // @ts-ignore
  return formatUrl(url);
};

@aws-sdk/s3-request-presigner

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/s3-request-presigner/latest.svg)](https://www.npmjs.com/package/@aws-sdk/s3-request-presigner) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/s3-request-presigner.svg)](https://www.npmjs.com/

Apache-2.0
Latest version published 1 day ago

Package Health Score

98 / 100
Full package analysis

Popular @aws-sdk/s3-request-presigner functions

Similar packages