Dashboard-Automatizase/lib/supabase.ts
Luis Erlacher 0152a2fda0 feat: add n8n API testing script for Google OAuth2 schema and existing credentials
- 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.
2025-10-10 14:29:02 -03:00

16 lines
601 B
TypeScript

import { createBrowserClient } from "@supabase/ssr";
// Validação de variáveis de ambiente obrigatórias
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
if (!supabaseUrl || !supabaseAnonKey) {
throw new Error(
"Missing required Supabase environment variables. " +
"Please ensure NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY are set.",
);
}
// Cliente Supabase para uso no browser - gerencia cookies automaticamente
export const supabase = createBrowserClient(supabaseUrl, supabaseAnonKey);