Stackwatch Docs
Service Setup

Supabase

Track database size, MAU, storage, and more

Stackwatch tracks your Supabase database size, monthly active users, storage buckets, and more. On Pro, it also monitors connections, cache hit ratio, realtime usage, edge function invocations, database egress, and gives you a per-table storage breakdown.

What you need

Two things:

  1. A Supabase Management API key — scoped to your account
  2. Your Project Reference ID — the unique ID for the specific project you want to monitor

Step 1 — Get your Management API key

  1. Go to supabase.com/dashboard/account/tokens
  2. Click Generate new token
  3. Give it a name, e.g. stackwatch
  4. Copy the token — it's only shown once

This is your account-level Management API key, not a project anon or service_role key. It lives under Account Settings, not inside a project.

Step 2 — Get your Project Reference ID

  1. Open your project in the Supabase dashboard
  2. Go to Project Settings → General
  3. Copy the Reference ID — it looks like abcdefghijklmnop (a 20-character alphanumeric string)

You can also find it in your project URL: https://supabase.com/dashboard/project/<your-ref-here>

Step 3 — Add the integration in Stackwatch

  1. Navigate to your project in the Stackwatch dashboard
  2. Go to the project's Integrations tab
  3. Find Supabase and click Add account
  4. Paste your Management API key into the API Key field
  5. Paste your Project Reference ID into the Project Ref field
  6. Give the integration a label (e.g. my-app-prod)
  7. Click Connect

What gets tracked

Free tier

MetricDescription
Database sizeTotal size of your PostgreSQL database vs 500 MB free limit
Monthly active usersUsers who signed in this calendar month vs 50,000 MAU limit
StorageTotal storage used across all buckets vs 1 GB free limit
Per-bucket storageStorage used per individual storage bucket

Pro tier (additional)

MetricDescription
Active DB connectionsCurrent open connections vs 60 connection limit
Cache hit ratioPostgreSQL buffer cache hit ratio (higher is better; shown as % of 100)
Per-table storageSize of each table in your public schema
Realtime messagesMessages sent via Realtime this month vs 2,000,000 limit
Realtime peak connectionsPeak concurrent Realtime connections vs limit
Edge function invocationsEdge function calls this month vs 500,000 limit
Database egressData egressed from the database vs limit (MB)

Per-table storage only includes tables in your public schema. Supabase's internal auth, storage, and realtime schemas are intentionally excluded.

Troubleshooting

"Invalid or expired Management API token" The token has been revoked or is incorrect. Regenerate a new one at supabase.com/dashboard/account/tokens and reconnect.

"Token lacks permission to query the database" Ensure you're using an account-level Management API key, not a project anon key or service_role key.

"Project not found or database query endpoint unavailable" The Project Reference ID is wrong, or the project has been paused/deleted. Note that free-tier Supabase projects pause after a period of inactivity — you'll need to unpause the project in the Supabase dashboard first.

"Supabase integration missing project_ref" The integration was saved without a Project Reference ID. Delete and re-add it with the correct ref.

Storage shows 0 If you have no storage buckets, storage will show as 0. The metric only appears if at least one bucket exists.

Token rotation

Supabase Management API tokens don't expire automatically, but you should rotate them periodically.

  1. Generate a new token at supabase.com/dashboard/account/tokens
  2. In Stackwatch, go to Integrations, find your Supabase integration, and click the edit (pencil) icon
  3. Paste the new token and save

You do not need to change the Project Ref unless you're switching projects.

On this page

    Docs