Supabase Elixir
Supabase Community Elixir SDK
def deps do
[
{:supabase_potion, "~> 0.8.0"}, # base SDK
{:supabase_storage, "~> 0.4"}, # storage integration
{:supabase_auth, "~> 0.6"}, # auth integration
{:supabase_postgrest, "~> 1.0"}, # postgrest integration
{:supabase_functions, "~> 0.1"}, # edge functions integration
{:supabase_realtime, "~> 0.1"}, # realtime integration
]
end
Individual product client documentation:
Clients
A Supabase.Client holds general information about Supabase that can be used to interact with any of the children integrations, for example: Supabase.Storage or Supabase.UI.
Usage
To create a Supabase.Client:
iex> Supabase.init_client("https://<supabase-url>", "<supabase-api-key>")
iex> {:ok, %Supabase.Client{}}
Any additional config can be passed as the third argument as an Enumerable:
iex> Supabase.init_client("https://<supabase-url>", "<supabase-api-key>",
db: [schema: "another"],
auth: [flow_type: :pkce],
global: [headers: %{"custom-header" => "custom-value"}]
)
iex> {:ok, %Supabase.Client{}}
Initialized clients are Elixir structs without any managed state.
HTTP Client Configuration
By default, supabase_potion starts a Finch pool named Supabase.Finch. You can customize this behavior with three application config keys:
:http_client
Replace the default Finch adapter with a custom HTTP client module:
config :supabase_potion, http_client: MyApp.CustomHTTPClient
When set, no Finch pool is started automatically.
:finch_name
Use your own Finch instance instead of the default Supabase.Finch:
config :supabase_potion, finch_name: MyApp.Finch
When set, no Finch pool is started automatically — you are responsible for starting the named Finch process.
:finch_pool
Customize the pool configuration for the default Supabase.Finch instance:
config :supabase_potion, finch_pool: %{default: [size: 25, count: 4]}
Only takes effect when using the default Finch pool (i.e. neither :http_client nor :finch_name are set). Defaults to %{default: [size: 10]}.