Hi guys, I am trying to now use the sbsecret... key from my supabase project instead of the legacy service role key. Example python code I am running below where it always raises an exception since I always get the error: Invalid API key. Can anyone help please?
try:
# Create admin client with service role key
self.admin_client: Client = create_client(
SUPABASE_URL,
SUPABASE_SECRET_KEY
)
url_preview = SUPABASE_URL[:40] if SUPABASE_URL else "N/A"
logger.info(f"Supabase client initialized - ENV: {APP_ENV}, URL: {url_preview}...")
except Exception as e:
logger.error(f"Failed to initialize Supabase admin client: {str(e)}")
raise