Holds configuration for talking to the Synctera API. Construct one with
new/1 and pass it as the first argument to every Synctera.* resource
function, per Elixir convention (cf. Ecto.Repo, Req.Request).
Summary
Functions
Builds a new client.
Types
@type environment() :: :sandbox | :t_minus_10 | :production
@type t() :: %Synctera.Client{ api_key: String.t(), auto_generate_ledger_idempotency_keys: boolean(), base_url: String.t(), default_device_info: Synctera.DeviceInfo.t() | nil, default_headers: [{String.t(), String.t()}], environment: environment(), on_response: (map() -> any()) | nil, receive_timeout_ms: pos_integer(), retry: Synctera.Retry.t() }
Functions
Builds a new client.
Options
:api_key— required unless theSYNCTERA_API_KEYenvironment variable is set.:environment—:sandbox(default),:t_minus_10, or:production.:base_url— overrides the environment-derived base URL entirely (e.g. for a mock server in tests).:receive_timeout_ms— default30_000.:retry— a%Synctera.Retry{}struct, or a keyword list of its fields.:auto_generate_ledger_idempotency_keys— defaultfalse. SeeSynctera.Idempotencyfor why this is opt-in.:default_device_info— a%Synctera.DeviceInfo{}attached to every request unless overridden per-call.:default_headers— extra headers merged into every request.:on_response— a 1-arity function called after every response with a map of%{method:, url:, status:, request_id:, duration_ms:}, useful for logging/metrics.
Raises Synctera.UsageError if no API key is available.