Client configuration shared by Medplum API requests.
Summary
Types
Base Medplum URL without a trailing slash.
OAuth client id used for the client credentials grant.
OAuth client secret paired with the client id.
FHIR version segment used in request paths. Defaults to "R4".
Default headers merged into every FHIR request.
Extra Req options forwarded to outgoing requests.
Client state used to authenticate requests and build FHIR URLs.
Types
@type base_url() :: String.t()
Base Medplum URL without a trailing slash.
@type client_id() :: String.t()
OAuth client id used for the client credentials grant.
@type client_secret() :: String.t()
OAuth client secret paired with the client id.
@type fhir_version() :: String.t()
FHIR version segment used in request paths. Defaults to "R4".
Default headers merged into every FHIR request.
@type req_options() :: keyword()
Extra Req options forwarded to outgoing requests.
@type retry() :: false | :safe_transient | :transient
Retry strategy passed through to Req.
@type t() :: %Medplum.Client{ auth_req_options: req_options(), base_url: base_url(), cache_tokens: boolean(), client_id: client_id(), client_secret: client_secret(), default_headers: headers(), fhir_version: fhir_version(), max_retries: non_neg_integer(), req_options: req_options(), retry: retry(), token_refresh_skew: non_neg_integer() }
Client state used to authenticate requests and build FHIR URLs.
Functions
Builds a Medplum client.
The base_url value is normalized by trimming a trailing slash, and
fhir_version defaults to "R4" when it is not provided.
Builds a Medplum client and raises on invalid configuration.