Cleanup
This commit is contained in:
20
packages/supabase/src/get-supabase-client-keys.ts
Normal file
20
packages/supabase/src/get-supabase-client-keys.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { invariant } from '@epic-web/invariant';
|
||||
|
||||
/**
|
||||
* Returns and validates the Supabase client keys from the environment.
|
||||
*/
|
||||
export function getSupabaseClientKeys() {
|
||||
const env = process.env;
|
||||
|
||||
invariant(env.NEXT_PUBLIC_SUPABASE_URL, `Supabase URL not provided`);
|
||||
|
||||
invariant(
|
||||
env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
|
||||
`Supabase Anon Key not provided`,
|
||||
);
|
||||
|
||||
return {
|
||||
url: env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
anonKey: env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user