INNER CODE UNIT · Python
list_supabase_projects
phasehq/console · backend/api/utils/syncing/supabase/main.py:34
def list_supabase_projects(credential_id):
"""List all Supabase projects accessible with the given access token."""
credentials = get_credentials(credential_id)
access_token = credentials.get("access_token")
response = requests.get(
f"{SUPABASE_API_BASE_URL}/projects",
headers=get_supabase_headers(access_token),
)
if response.status_code == 200:
return [
{
# "id" is deprecated upstream in favour of "ref"
"id": project.get("ref") or project["id"],
"name": project["name"],
"region": project.get("region"),
}