mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 18:25:24 +02:00
23 lines
685 B
JavaScript
23 lines
685 B
JavaScript
import { createClient } from '@supabase/supabase-js';
|
|||
|
|
import dotenv from 'dotenv';
|
||
|
|
dotenv.config({ path: '.env.local' });
|
||
|
|
|
||
|
|
const supabase = createClient(
|
||
|
|
process.env.SUPABASE_URL || '',
|
||
|
|
process.env.SUPABASE_SERVICE_KEY || process.env.SUPABASE_ANON_KEY || ''
|
||
|
|
);
|
||
|
|
|
||
|
|
async function testFetch() {
|
||
|
|
const { data: exps, error: err1 } = await supabase.from('experiments').select('*').limit(10);
|
||
|
|
if (err1 || !exps?.length) {
|
||
|
|
console.log('No experiments found or error:', err1);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
for (const exp of exps) {
|
||
|
|
console.log(`[${exp.id}] Name: ${exp.name} | Start: ${exp.start_date} | ASINs: ${JSON.stringify(exp.asins)}`);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
testFetch();
|