Download client/src/lib/supabaseClient.ts from zuocong12/README: direct link, hf CLI and curl.
- Browser
- Download file 564 Bytes
-
https://huggingface.co/spaces/zuocong12/README/resolve/main/client/src/lib/supabaseClient.ts
- Command line
-
hf download hf://spaces/zuocong12/README/client/src/lib/supabaseClient.ts
-
curl -L -o supabaseClient.ts https://huggingface.co/spaces/zuocong12/README/resolve/main/client/src/lib/supabaseClient.ts
564 Bytes
| import { createClient } from '@supabase/supabase-js'; | |
| // 从环境变量获取Supabase配置 | |
| const supabaseUrl = import.meta.env.VITE_SUPABASE_URL; | |
| const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY; | |
| if (!supabaseUrl || !supabaseAnonKey) { | |
| console.warn('⚠️ Supabase配置缺失,请检查.env文件'); | |
| } | |
| // 创建Supabase客户端 | |
| export const supabase = createClient(supabaseUrl || '', supabaseAnonKey || '', { | |
| auth: { | |
| persistSession: false, // 本地模式不需要会话持久化 | |
| autoRefreshToken: false, | |
| }, | |
| }); |