Supabase.Client.Storage (supabase_potion v0.8.0)

Storage service configuration schema for Supabase client.

This module defines configuration options for the Storage service, enabling support for large file uploads and custom storage routing.

Fields

  • :use_new_hostname - When true, transforms the storage URL to use the storage-specific subdomain (e.g., project.supabase.co becomes project.storage.supabase.co). This subdomain is optimized for large file uploads (>50GB) and provides better streaming performance. Defaults to false for backward compatibility. Only applies to official Supabase domains (.supabase.co, .supabase.in, .supabase.red). Custom domains are left untouched.

Examples

# Use default storage hostname (backward compatible)
%Supabase.Client.Storage{use_new_hostname: false}

# Use storage subdomain for large file uploads
%Supabase.Client.Storage{use_new_hostname: true}

Summary

Types

Storage configuration parameters.

t()

Storage configuration struct.

Functions

Creates a changeset for storage configuration.

Types

params()

@type params() :: %{optional(:use_new_hostname) => boolean()}

Storage configuration parameters.

t()

@type t() :: %Supabase.Client.Storage{use_new_hostname: boolean()}

Storage configuration struct.

  • :use_new_hostname - Enable storage subdomain transformation for large uploads

Functions

changeset(schema, params)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

Creates a changeset for storage configuration.

Parameters

  • schema - The storage config struct
  • params - Map or keyword list of configuration parameters

Examples

iex> changeset(%Supabase.Client.Storage{}, %{use_new_hostname: true})
#Ecto.Changeset<...>

iex> changeset(%Supabase.Client.Storage{}, [use_new_hostname: false])
#Ecto.Changeset<...>