Files
real-time-fund/app/lib/supabase.js
2026-02-08 21:33:37 +08:00

18 lines
618 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { createClient } from '@supabase/supabase-js';
// Supabase 配置
// 注意:此处使用 publishable key可安全在客户端使用
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL || '';
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY || '';
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
auth: {
// 启用自动刷新 token
autoRefreshToken: true,
// 持久化 session 到 localStorage
persistSession: true,
// 检测 URL 中的 session用于邮箱验证回调
detectSessionInUrl: true
}
});