supabase-community/supabase-ex

A complete Toolkit to interact with Supabase APIs from Elixir

Elixir

158

70 commits

updated Oct 15, 2026

See the code

README

Supabase Elixir

Supabase Community Elixir SDK

Compatibility

We support the latest 3 stable Elixir versions.

def deps do
  [
    {:supabase_potion, "~> 1.0.0"}, # base SDK
    {:supabase_storage, "~> 0.6.1"}, # storage integration
    {:supabase_auth, "~> 1.0.1"}, # auth integration
    {:supabase_postgrest, "~> 1.3.0"}, # postgrest integration
    {:supabase_functions, "~> 0.1.0"}, # edge functions integration
    {:supabase_realtime, "~> 0.5.0"}, # 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

You can define a client module using the macro (similar to Ecto Repo). This approach reads configuration from your application config and builds a fresh client struct on each call:

# lib/my_app/supabase.ex
defmodule MyApp.Supabase do
  use Supabase.Client, otp_app: :my_app
end

# config/config.exs
config :my_app, MyApp.Supabase,
  base_url: "https://<supabase-url>",
  api_key: "<supabase-api-key>",
  db: [schema: "public"],
  auth: [flow_type: :pkce],
  global: [headers: %{"custom-header" => "custom-value"}]

# Usage
iex> client = MyApp.Supabase.get_client!()
iex> %Supabase.Client{}

Direct Initialization

Alternatively, you can create a client directly using Supabase.init_client/3:

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]}.

hacktoberfest
sdk-elixir
supabase
supabase-elixir

supabase-community/supabase-ex

A complete Toolkit to interact with Supabase APIs from Elixir

Elixir

158

70 commits

updated Oct 15, 2026

See the code

README

Supabase Elixir

Supabase Community Elixir SDK

Compatibility

We support the latest 3 stable Elixir versions.

def deps do
  [
    {:supabase_potion, "~> 1.0.0"}, # base SDK
    {:supabase_storage, "~> 0.6.1"}, # storage integration
    {:supabase_auth, "~> 1.0.1"}, # auth integration
    {:supabase_postgrest, "~> 1.3.0"}, # postgrest integration
    {:supabase_functions, "~> 0.1.0"}, # edge functions integration
    {:supabase_realtime, "~> 0.5.0"}, # 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

You can define a client module using the macro (similar to Ecto Repo). This approach reads configuration from your application config and builds a fresh client struct on each call:

# lib/my_app/supabase.ex
defmodule MyApp.Supabase do
  use Supabase.Client, otp_app: :my_app
end

# config/config.exs
config :my_app, MyApp.Supabase,
  base_url: "https://<supabase-url>",
  api_key: "<supabase-api-key>",
  db: [schema: "public"],
  auth: [flow_type: :pkce],
  global: [headers: %{"custom-header" => "custom-value"}]

# Usage
iex> client = MyApp.Supabase.get_client!()
iex> %Supabase.Client{}

Direct Initialization

Alternatively, you can create a client directly using Supabase.init_client/3:

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]}.

hacktoberfest
sdk-elixir
supabase
supabase-elixir

Significant stargazers

Zach Allaun

245 followers · starred Nov 2023

Filipe Cabaço

190 followers · starred Dec 2023

Tobias Pfeiffer

520 followers · starred Sep 2026

Andrey A.

66 followers · starred Oct 2025