Supabase.Client (supabase_potion v0.4.0)
A client for interacting with Supabase. This module is responsible for managing the connection options for your Supabase project.
Examples
%Supabase.Client{
conn: %{
base_url: "https://<app-name>.supabase.io",
api_key: "<supabase-api-key>",
access_token: "<supabase-access-token>"
},
db: %Supabase.Client.Db{
schema: "public"
},
global: %Supabase.Client.Global{
headers: %{}
},
auth: %Supabase.Client.Auth{
auto_refresh_token: true,
debug: false,
detect_session_in_url: true,
flow_type: :implicit,
persist_session: true,
storage: nil,
storage_key: "sb-<host>-auth-token"
}
}
iex> Supabase.Client.retrieve_connection(%Supabase.Client{})
%Supabase.Client.Conn{
base_url: "https://<app-name>.supabase.io",
api_key: "<supabase-api-key>",
access_token: "<supabase-access-token>"
}
Summary
Functions
Given a Supabase.Client
, mounts the base url for the Auth/GoTrue feature.
Given a Supabase.Client
, return the raw the base url for the Supabase project.
Given a Supabase.Client
, return the connection informations.
Given a Supabase.Client
, mounts the base url for the Storage feature.
Types
Link to this type
params()
@type params() :: %{ conn: Supabase.Client.Conn.params(), db: Supabase.Client.Db.params(), global: Supabase.Client.Global.params(), auth: Supabase.Client.Auth.params() }
@type t() :: %Supabase.Client{ auth: Supabase.Client.Auth.t(), conn: Supabase.Client.Conn.t(), db: Supabase.Client.Db.t(), global: Supabase.Client.Global.t() }
Functions
Link to this function
parse(attrs)
@spec parse(params()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Link to this function
parse!(attrs)
Link to this function
retrieve_auth_url(client, uri \\ "/")
Given a Supabase.Client
, mounts the base url for the Auth/GoTrue feature.
Examples
iex> Supabase.Client.retrieve_auth_url(%Supabase.Client{})
"https://<app-name>.supabase.co/auth/v1"
Link to this function
retrieve_base_url(client)
Given a Supabase.Client
, return the raw the base url for the Supabase project.
Examples
iex> Supabase.Client.retrieve_base_url(%Supabase.Client{})
"https://<app-name>.supabase.co"
Link to this function
retrieve_connection(client)
@spec retrieve_connection(t()) :: Supabase.Client.Conn.t()
Given a Supabase.Client
, return the connection informations.
Examples
iex> Supabase.Client.retrieve_connection(%Supabase.Client{})
%Supabase.Client.Conn{}
Link to this function
retrieve_storage_url(client, uri \\ "/")
Given a Supabase.Client
, mounts the base url for the Storage feature.
Examples
iex> Supabase.Client.retrieve_storage_url(%Supabase.Client{})
"https://<app-name>.supabase.co/storage/v1"
Link to this function