import { createClient } from '@supabase/supabase-js';
import dotenv from 'dotenv';
dotenv.config({ path: './web/.env' });

const supabaseUrl = process.env.VITE_SUPABASE_URL;
const supabaseKey = process.env.VITE_SUPABASE_ANON_KEY;

if (!supabaseUrl || !supabaseKey) {
  console.log("Missing Supabase credentials in .env");
  process.exit(1);
}

const supabase = createClient(supabaseUrl, supabaseKey);

async function test() {
  console.log("Checking notifications table...");
  const { data, error } = await supabase.from('notifications').select('*').limit(1);
  if (error) {
    console.error("Error accessing notifications table:", error.message);
  } else {
    console.log("Notifications table exists!");
  }
}
test();
