Supabase.Client.Behaviour behaviour (supabase_potion v0.6.1)

The behaviour for the Supabase Client. This behaviour is used to define the API for a Supabase Client.

If you're implementing a Self Managed Client as the Supabase.Client, this behaviour is already implemented for you.

If you're implementing a One Off Client as the Supabase.Client, you need to implement this behaviour in case you want to use the integration with Supabase.GoTrue for Plug based application or Phoenix.LiveView applications.

Summary

Callbacks

get_client()

(optional)
@callback get_client() :: {:ok, Supabase.Client.t()} | {:error, :not_found}

get_client(arg1)

(optional)
@callback get_client(pid() | atom()) :: {:ok, Supabase.Client.t()} | {:error, :not_found}

init()

@callback init() :: {:ok, Supabase.Client.t()} | {:error, Ecto.Changeset.t()}

set_auth(arg1, access_token)

(optional)
@callback set_auth(pid() | atom(), access_token :: String.t()) :: :ok