Can I query the usage of my project?

I want to get the usage of my project without using the dashboard (DB & storage info). I have been Can I get this with supabase js client and an sql query? Currently I have been trying this in the sql editor:

select SUM(CAST(metadata->>'size' AS numeric)) AS total_size from storage.objects

In the end I want to get the data when server rendering a page, but I just dont know how or if I can get this info?
Was this page helpful?