API Reference

Use the getTotalSize method to retrieve the total storage size used by authenticated user.

try {
  const [data, error] = await sdk.file.getTotalSize();

  if (error) {
    console.error("Failed to retrieve total storage size:", error);
  } else {
    console.log("Total storage used:", data.totalSize, "bytes");
  }
} catch (error) {
  console.error(
    "An unexpected error occurred while retrieving total storage size:",
    error.message
  );
}

Required API Key Permission

  • Read Directory