Spaces:
Running
Running
Download bioai-platform/frontend/src/lib/supabase.ts from Samad14/bio-nexus-api: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/spaces/Samad14/bio-nexus-api/resolve/main/bioai-platform/frontend/src/lib/supabase.ts
- Command line
-
hf download hf://spaces/Samad14/bio-nexus-api/bioai-platform/frontend/src/lib/supabase.ts
-
curl -L -o supabase.ts https://huggingface.co/spaces/Samad14/bio-nexus-api/resolve/main/bioai-platform/frontend/src/lib/supabase.ts
579 Bytes
| import { createClient } from '@supabase/supabase-js'; | |
| let _client: ReturnType<typeof createClient> | null = null; | |
| export function getSupabase() { | |
| if (!_client) { | |
| const url = process.env.NEXT_PUBLIC_SUPABASE_URL; | |
| const key = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY; | |
| if (!url || !key) { | |
| throw new Error('Missing NEXT_PUBLIC_SUPABASE_URL or NEXT_PUBLIC_SUPABASE_ANON_KEY'); | |
| } | |
| _client = createClient(url, key, { | |
| auth: { flowType: 'pkce', persistSession: true, autoRefreshToken: true, detectSessionInUrl: false }, | |
| }); | |
| } | |
| return _client; | |
| } | |