From 567952ca77dd72c56ff010ee593ebea41fcd3180 Mon Sep 17 00:00:00 2001 From: EthanAuyeung Date: Sun, 1 Oct 2023 15:07:11 -0700 Subject: [PATCH] Added supabase to repo --- src/api/supabase/queries /createClient.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/api/supabase/queries /createClient.ts diff --git a/src/api/supabase/queries /createClient.ts b/src/api/supabase/queries /createClient.ts new file mode 100644 index 00000000..e576c68f --- /dev/null +++ b/src/api/supabase/queries /createClient.ts @@ -0,0 +1,20 @@ +import { createClient } from '@supabase/supabase-js'; +import dotenv from 'dotenv'; + +dotenv.config(); + +if ( + !process.env.NEXT_PUBLIC_SUPABASE_URL || + !process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY +) { + throw new Error( + 'No Supabase environment variables detected, please make sure they are in place!', + ); +} + +const supabase = createClient( + process.env.NEXT_PUBLIC_SUPABASE_URL, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY, +); + +export default supabase; \ No newline at end of file