SupabaseS
Supabase12mo ago
Nikhil

Storage.List not returning documented fields

Hey all, I'm using supabase-js and the storage.from.list API doesn't seem to be returning all required fields.

According to the docs the response is missing required fields like bucket_id, buckets, owner, etc.

I'm using a service_key so expect all RLS checks to be off.

Any ideas on what might be off / if I'm doing something wrong?

My code
const supabase = createClient(URL, SERVICE_KEY);

const { data, error } = await supabase.storage
    .from("raw_gmail_data")
    .list("cm4rm05e20000fnfe7uyxv8w5", { limit: 10 });

  if (error) {
    throw error;
  }

console.log(JSON.stringify(data, null, 2));


Returns
[
  {
    "name": "00004b867db32841b49a21cfbf6aa222411b38279115ed828dc091e8e1ba14ac",
    "id": "aa8c1a2d-7b05-4ca1-89b5-fe089f9f7a1d",
    "updated_at": "2025-01-21T06:32:43.824Z",
    "created_at": "2025-01-21T06:32:43.824Z",
    "last_accessed_at": "2025-01-21T06:32:43.824Z",
    "metadata": {
      "eTag": "\"e2e4b96020da97e29c70aa48a1388126\"",
      "size": 18353,
      "mimetype": "text/plain;charset=UTF-8",
      "cacheControl": "max-age=3600",
      "lastModified": "2025-01-21T06:32:44.000Z",
      "contentLength": 18353,
      "httpStatusCode": 200
    }
  },
  ...
]
Supabase API reference for JavaScript: List all files in a bucket
Was this page helpful?