Circle V2 API Docs
    Preparing search index...

    Function getStorageConfig

    • Build a StorageConfig from the current browser session.

      Uses @supabase/ssr to read the auth session from cookies set during login. This encapsulates the Supabase dependency so your app code never imports it.

      Parameters

      Returns Promise<StorageConfig>

      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 });