Sample code for 30+ languages & platforms
React Native

S3 Delete Bucket

See more Amazon S3 Examples

Demonstrates how to delete a bucket.

Chilkat React Native Downloads

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

async 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 = 'ABQXXABC83ABCDEFVQXX';

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

  http.keepResponseBody = true;

  try {
    await http.s3DeleteBucketAsync('chilkattestbucket');
    console.log('Bucket deleted.');
  } catch {
    console.log(http.lastErrorText);
    // Also examine the error response body from AWS:
    console.log(http.lastResponseBody);
  }
}