initial
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { createClient as createSupabaseClient, type SupabaseClient } from '@supabase/supabase-js';
|
||||
|
||||
import type { Database, SupabaseConfig } from './types.js';
|
||||
|
||||
// Typed client alias used throughout the app.
|
||||
export type AppSupabaseClient = SupabaseClient<Database>;
|
||||
|
||||
export function createClient(config: SupabaseConfig): AppSupabaseClient {
|
||||
return createSupabaseClient<Database>(config.url, config.anonKey, {
|
||||
auth: {
|
||||
storage: config.sessionStorage,
|
||||
autoRefreshToken: true,
|
||||
persistSession: true,
|
||||
detectSessionInUrl: config.detectSessionInUrl ?? false,
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user