Nombaone. Client
(Nomba One v0.1.0)
View Source
The API client — configuration plus the HTTP engine's context.
Build one with Nombaone.new/2 (a thin delegate to new/2 here) and thread
it as the first argument to every resource call. The struct is plain data and
safe to share across processes.
Options
:api_key— your secret key (nbo_sandbox_…/nbo_live_…). Defaults to theNOMBAONE_API_KEYenvironment variable. Server-side only.:base_url— override the API origin (no/v1). Defaults to the host matching the key's environment. Required if the key prefix is unknown.:timeout— per-attempt timeout in milliseconds. Default30_000.:max_retries— automatic retry budget. Default2(3 attempts total).:transport— aNombaone.Transportmodule. DefaultNombaone.Transport.HTTPC.:transport_options— an opaque term passed to the transport.:default_headers— a map of headers added to every request.
The read-only :mode and :base_url fields are derived at construction.
Summary
Functions
The built-in host for each environment.
Build a client. See the module doc for options. Raises ArgumentError on a
missing or unrecognized key (a configuration mistake should fail loudly, at
construction — not on the first request).
Types
@type mode() :: :sandbox | :live
The environment the key (and everything created with it) lives in.
@type t() :: %Nombaone.Client{ api_key: String.t(), base_url: String.t(), default_headers: map(), max_retries: non_neg_integer(), mode: mode(), timeout: non_neg_integer(), transport: module(), transport_options: term() }
Functions
The built-in host for each environment.
Build a client. See the module doc for options. Raises ArgumentError on a
missing or unrecognized key (a configuration mistake should fail loudly, at
construction — not on the first request).