API Reference

Use the getTotalSize method to retrieve the total size (in bytes) of a specific drive.

try {
  const id = 'drive_id_here'; // The ID of the drive to get the size of.
  
  const [data, error] = await sdk.drive.getTotalSize({ id });

  // Check for success
  if (error) {
    console.error(error);
  } else {
    console.log(`Drive Size: `, data);
  }
} catch (error) {
  console.error(error.message);
}

Params

  • id (string): The ID of the drive to get the size of.

Required API Key Permission

  • Read Directory