RevenueCat.Client behaviour (revenue_cat v0.1.0)

Copy Markdown View Source

Behaviour for RevenueCat client adapters.

Required callbacks cover the simple global-config API. Optional callbacks cover the public overloads (opts and client-struct forms).

Summary

Types

app_user_id_or_options()

@type app_user_id_or_options() :: String.t() | keyword()

client_or_app_user_id()

@type client_or_app_user_id() :: RevenueCat.t() | String.t()

entitlement_or_options()

@type entitlement_or_options() :: String.t() | keyword()

Callbacks

delete_customer(t)

@callback delete_customer(String.t()) :: :ok | {:error, term()}

delete_customer(client_or_app_user_id, app_user_id_or_options)

(optional)
@callback delete_customer(client_or_app_user_id(), app_user_id_or_options()) ::
  :ok | {:error, term()}

has_active_entitlement(t, t)

@callback has_active_entitlement(String.t(), String.t()) ::
  {:ok, boolean()} | {:error, term()}

has_active_entitlement(client_or_app_user_id, t, entitlement_or_options)

(optional)
@callback has_active_entitlement(
  client_or_app_user_id(),
  String.t(),
  entitlement_or_options()
) :: {:ok, boolean()} | {:error, term()}