- Implemented a bash script to test n8n API and retrieve credential schemas. - Added types for API responses, Google Calendar, and WhatsApp instances. - Configured Vitest for testing with React and added setup for testing-library.
24 lines
760 B
TypeScript
24 lines
760 B
TypeScript
import { createClient } from "@supabase/supabase-js";
|
|
|
|
// IMPORTANTE: Este arquivo só deve ser importado em código server-side
|
|
// (API routes, Server Components, Server Actions)
|
|
// NUNCA importe em Client Components ('use client')
|
|
|
|
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
|
|
const serviceRoleKey = process.env.SUPABASE_SERVICE_ROLE_KEY;
|
|
|
|
if (!supabaseUrl || !serviceRoleKey) {
|
|
throw new Error(
|
|
"Missing SUPABASE_SERVICE_ROLE_KEY environment variable. " +
|
|
"This is required for admin operations.",
|
|
);
|
|
}
|
|
|
|
// Cliente Supabase Admin para operações privilegiadas (apenas server-side)
|
|
export const supabaseAdmin = createClient(supabaseUrl, serviceRoleKey, {
|
|
auth: {
|
|
autoRefreshToken: false,
|
|
persistSession: false,
|
|
},
|
|
});
|