Circle V2 API Docs
    Preparing search index...

    Function createSignedUrlFromFileUrl

    • Convenience helper: parse a Supabase storage URL (any variant — public, authenticated, or sign) into { bucket, path } and mint a signed download URL for it in one call.

      Consolidates a pattern we previously duplicated across the generate-note mutation and the get-playback-url query. Both callers just had a file URL from our DB and needed a short-lived download URL back.

      Parameters

      Returns Promise<Safe<SignedUrlResult>>

      server-side (webhook, mutation)
      const result = await createSignedUrlFromFileUrl(fileUrl, 3600, {
      supabaseUrl: process.env.SUPABASE_URL!,
      apiKey: process.env.SUPABASE_SERVICE_ROLE_KEY!,
      });
      client-side (user-scoped)
      const result = await createSignedUrlFromFileUrl(fileUrl, 60, {
      supabaseUrl,
      apiKey: supabaseAnonKey,
      accessToken: userJwt,
      });