import { getStorageConfig, uploadFile } from "@repo/storage/client";
const config = await getStorageConfig({
supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL!,
supabaseAnonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
});
const result = await uploadFile(config, { bucket, key, body, contentType });
Build a
StorageConfigfrom the current browser session.Uses
@supabase/ssrto read the auth session from cookies set during login. This encapsulates the Supabase dependency so your app code never imports it.