fix issues
This commit is contained in:
@@ -7,14 +7,6 @@
|
||||
"types": "./src/index.ts",
|
||||
"default": "./src/index.ts"
|
||||
},
|
||||
"./client": {
|
||||
"types": "./src/client.ts",
|
||||
"default": "./src/client.ts"
|
||||
},
|
||||
"./server": {
|
||||
"types": "./src/server.ts",
|
||||
"default": "./src/server.ts"
|
||||
},
|
||||
"./types": {
|
||||
"types": "./src/types.ts",
|
||||
"default": "./src/types.ts"
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
import type { Database } from './types'
|
||||
|
||||
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!
|
||||
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
|
||||
|
||||
/**
|
||||
* Supabase client for client-side use with anon key
|
||||
* Uses Row Level Security (RLS) policies
|
||||
*/
|
||||
export const supabase = createClient<Database>(supabaseUrl, supabaseAnonKey)
|
||||
@@ -1,10 +1,9 @@
|
||||
/**
|
||||
* Database package
|
||||
* Exports Supabase clients, Drizzle ORM, and types
|
||||
* Exports Drizzle ORM and types
|
||||
* Note: Supabase clients are kept in the app's lib directory to avoid build-time initialization
|
||||
*/
|
||||
|
||||
export { supabase } from './client'
|
||||
export { supabaseAdmin } from './server'
|
||||
export type { Database as SupabaseDatabase } from './types'
|
||||
|
||||
// Drizzle exports
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
import type { Database } from './types'
|
||||
|
||||
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!
|
||||
const supabaseServiceRoleKey = process.env.SUPABASE_SERVICE_ROLE_KEY!
|
||||
|
||||
/**
|
||||
* Supabase client for server-side use with service role key
|
||||
* Bypasses Row Level Security (RLS) - use with caution
|
||||
* Always filter by user_id to enforce permissions
|
||||
*/
|
||||
export const supabaseAdmin = createClient<Database>(supabaseUrl, supabaseServiceRoleKey, {
|
||||
auth: {
|
||||
persistSession: false,
|
||||
autoRefreshToken: false,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user