Download backend/src/lib/supabase.js from Shiva7706/BlueFin: direct link, hf CLI and curl.
- Browser
- Download file 586 Bytes
-
https://huggingface.co/spaces/Shiva7706/BlueFin/resolve/main/backend/src/lib/supabase.js
- Command line
-
hf download hf://spaces/Shiva7706/BlueFin/backend/src/lib/supabase.js
-
curl -L -o supabase.js https://huggingface.co/spaces/Shiva7706/BlueFin/resolve/main/backend/src/lib/supabase.js
586 Bytes
| import { createClient } from "@supabase/supabase-js"; | |
| import config from "../config.js"; | |
| let supabase = null; | |
| function getClient() { | |
| if (!supabase) { | |
| if ( | |
| !config.supabaseUrl || | |
| config.supabaseUrl === "your_supabase_url_here" | |
| ) { | |
| throw new Error("SUPABASE_URL is not configured in .env"); | |
| } | |
| supabase = createClient(config.supabaseUrl, config.supabaseServiceKey); | |
| } | |
| return supabase; | |
| } | |
| // Proxy so callers can do `supabase.from(...)` directly | |
| export default new Proxy( | |
| {}, | |
| { | |
| get(_, prop) { | |
| return getClient()[prop]; | |
| }, | |
| }, | |
| ); | |