Sample code for 30+ languages & platforms
React Native Requires Chilkat v11.0.0+

Generate S3 Signed URL

See more Amazon S3 Examples

Demonstrates how to generate a pre-signed S3 URL.

Chilkat React Native Downloads

React Native
import { Http } from '@chilkat/react-native'

function chilkatExample() {
  // This example assumes the Chilkat API to have been previously unlocked.
  // See Global Unlock Sample for sample code.

  const http = new Http();

  // Insert your access key here:
  http.awsAccessKey = 'AWS_ACCESS_KEY';

  // Insert your secret key here:
  http.awsSecretKey = 'AWS_SECRET_KEY';

  http.awsRegion = 'us-west-2';
  http.awsEndpoint = 's3-us-west-2.amazonaws.com';

  const bucketName = 'chilkattest';
  const path = 'starfish.jpg';

  let signedUrl: string;
  try {
    signedUrl = http.s3GenPresignedUrl('GET', true, bucketName, path, 3600, 's3');
  } catch {
    console.log(http.lastErrorText);
    return;
  }

  console.log(signedUrl);
}