title: S3 getSignedUrl v2 equivalent in AWS Javascript SDK v3
body: <p>I just started using aws-sdk on my app to upload files to S3, and i'm debating whether to use aws-sdk v2 or v3.</p>
  <p>V2 is the whole package, which is super bloated considering i only need the s3 services, not the myriad of other options. However, the documentation is very cryptic and im having a really hard time getting the equivalent getSignedUrl function to work in v3.</p>
  <p>In v2, i have this code to sign the url and it works fine. I am using express on the server</p>
  <pre><code>import aws from 'aws-sdk';
  
  const signS3URL = (req,res,next) =&gt; {
      const s3 = new aws.S3({region:'us-east-2'});
      const {fileName,fileType} = req.query;
      const s3Params = {
          Bucket : process.env.S3_BUCKET,
          Key : fileName,
          ContentType:fileType,
          Expires: 60,
      };
  
      s3.getSignedUrl('putObject',s3Params,(err,data)=&gt;{
          if(err){
              next(err);
          }
          res.json(data);
      });
  }
  </code></pre>
  <p>Now I've been reading documentation and examples trying to get the v3 equivalent to work, but i cant find any working example of how to use it. Here is how I have set it up so far</p>
  <pre><code>import {S3Client,PutObjectCommand} from '@aws-sdk/client-s3';
  import {getSignedUrl} from '@aws-sdk/s3-request-presigner';
  
  export const signS3URL = async(req,res,next) =&gt; {
      console.log('Sign')
      const {fileName,fileType} = req.query;
      const s3Params = {
          Bucket : process.env.S3_BUCKET,
          Key : fileName,
          ContentType:fileType,
          Expires: 60,
          // ACL: 'public-read'
      };
  
      const s3 = new S3Client()
      s3.config.region = 'us-east-2'
      const command = new PutObjectCommand(s3Params)
      console.log(command)
  
  
      await getSignedUrl(s3,command).then(signature =&gt;{
          console.log(signature)
          res.json(signature)
      }).catch(e=&gt;next(e))
  }
  </code></pre>
  <p>There are some errors in this code, and the first I can identify is creating the <code>command</code> variable using the <code>PutObjectCommand</code> function provided by the SDK. The documentation does not clarify to me what i need to pass it as the &quot;input&quot; <a href="https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/globals.html#putobjectcommandinput" rel="nofollow noreferrer">https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/globals.html#putobjectcommandinput</a></p>
  <p>Does anyone with experience using aws-sdk v3 know how to do this?</p>
  <p>Also a side-question, where can i find the api reference for v2???? cuz all i find is the sdk docs that say &quot;v3 now available&quot; and i cant seem to find the reference to v2....</p>
  <p>thanks for your time</p>