aethex-forge/client/lib/supabase.ts
Builder.io 71ce8dce2d Create Supabase configuration
cgen-b9943585781b4c149ec41b73047a1192
2025-08-06 00:02:38 +00:00

29 lines
739 B
TypeScript

import { createClient } from '@supabase/supabase-js';
import type { Database } from './database.types';
const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;
if (!supabaseUrl || !supabaseAnonKey) {
throw new Error('Missing Supabase environment variables');
}
export const supabase = createClient<Database>(supabaseUrl, supabaseAnonKey, {
auth: {
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: true
}
});
// Auth helpers
export const auth = supabase.auth;
// Database helpers
export const db = supabase.from;
// Storage helpers
export const storage = supabase.storage;
// Real-time helpers
export const channel = supabase.channel;