romio_explore_ai_api / utils /supabase_client.py
marcolouis's picture
refactor: Clean up main.py and README for clarity and organization
2777769
Raw History Blame Contribute Delete
472 Bytes
from supabase import create_client
from dotenv import load_dotenv
import os
load_dotenv()
SUPABASE_URL = os.getenv("SUPABASE_URL")
SUPABASE_SERVICE_ROLE_KEY = os.getenv("SUPABASE_SERVICE_ROLE_KEY")
def get_supabase_client():
if not SUPABASE_URL or not SUPABASE_SERVICE_ROLE_KEY:
raise RuntimeError(
"SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY must be defined in .env"
)
return create_client(SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY)