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

Functions

@spec parse(params()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
@spec parse!(params()) :: t()
Link to this function

retrieve_auth_url(client, uri \\ "/")

@spec retrieve_auth_url(t(), String.t()) :: String.t()

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)

@spec retrieve_base_url(t()) :: String.t()

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 \\ "/")

@spec retrieve_storage_url(t(), String.t()) :: String.t()

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

update_access_token(client, access_token)

@spec update_access_token(t(), String.t()) :: t()