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

Backblaze S3 Delete Bucket Objects

See more Backblaze S3 Examples

Demonstrates how to delete objects in a bucket.

Chilkat React Native Downloads

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

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

  const http = new Http();

  // keyID = Access Key ID or Access Key
  http.awsAccessKey = 'access-key';

  // applicationKey = Secret Access Key or Secret Key
  http.awsSecretKey = 'secret-key';

  // Region is the 2nd part of your S3 Endpoint
  http.awsEndpoint = 's3.us-west-002.backblazeb2.com';

  const bucketName = 'chilkat-test';

  const objectName1 = 'seahorse.jpg';
  const objectName2 = 'orchard.json';

  const st = new StringTable();
  st.append(objectName1);
  st.append(objectName2);

  const jsonResp = new JsonObject();
  try {
    await http.s3DeleteObjectsAsync(bucketName, st, jsonResp);
  } catch {
    console.log(http.lastErrorText);
    return;
  }

  console.log(`Response status code = ${http.lastStatus}`);

  // Display the JSON response.
  jsonResp.emitCompact = false;
  console.log(jsonResp.emit());
}