Content loader utility, Content directory structuur

This commit is contained in:
colinislit
2025-11-15 22:06:48 +01:00
parent dbde412465
commit 690e7b7c43
37 changed files with 9447 additions and 1035 deletions

25
lib/supabase/server.ts Normal file
View File

@@ -0,0 +1,25 @@
import { createClient } from '@supabase/supabase-js'
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!
const supabaseServiceRoleKey = process.env.SUPABASE_SERVICE_ROLE_KEY!
if (!supabaseUrl || !supabaseServiceRoleKey) {
throw new Error('Missing Supabase server environment variables. Check your .env.local file.')
}
/**
* Supabase client for server-side operations.
* Uses service role key - NEVER expose to client!
* Bypasses Row Level Security (RLS) - use with caution.
*
* Use this for:
* - API routes that need admin access
* - Database migrations/seeding
* - Server-side operations
*/
export const supabaseAdmin = createClient(supabaseUrl, supabaseServiceRoleKey, {
auth: {
autoRefreshToken: false,
persistSession: false,
},
})