title: How to use S3 temporary credential to upload file in Javascript
body: <p>All,
  I tried to use S3 temporary Javascript SDK to upload file to S3, but to be honest,I can not find out any working sample for this, including S3 documentation.</p>
  
  <p>Ideally, I should be able to do this:</p>
  
  <p>s3Client = new AWS.client(new TemporaryCredential( keyId, accesskey, token ));</p>
  
  <p>But I check the documentation, no place is mentioning how to use the temporary credentials to create S3 client.</p>
  
  <p>Our company is already having the api to get temporary credentials, so I am really interested in knowing how to do this in javascript.</p>
  
  <p>I don't know if there are js equivelant solution to below java code:</p>
  
  <pre><code>BasicSessionCredentials sessionCredentials = new BasicSessionCredentials(
     session_creds.getAccessKeyId(),
     session_creds.getSecretAccessKey(),
     session_creds.getSessionToken());
  
  AmazonS3 s3 = AmazonS3ClientBuilder.standard()
                          .withCredentials(new AWSStaticCredentialsProvider(sessionCredentials)
                          .build();
  </code></pre>
  
  <p>Thanks for your suggestion.</p>