Configuration normalization for FactorialHR.
The library accepts explicit keyword options and has a small environment fallback for scripts. Host applications should normally pass credentials from their own configuration layer instead of relying on process environment.
Summary
Functions
Builds a normalized configuration struct from keyword options or a map.
Types
@type auth_mode() :: :api_key | :bearer
Functions
@spec new(keyword() | map() | t()) :: {:ok, t()} | {:error, FactorialHR.Error.t()}
Builds a normalized configuration struct from keyword options or a map.
Supported options:
:api_key,:access_tokenor:token:auth_mode/:authas:api_key,"api_key",:bearer, or"bearer":base_urlor:api_url:api_version:company_id,:author_id:req_options:receive_timeout
If no token is supplied, FACTORIAL_API_KEY, FACTORIAL_ACCESS_TOKEN, and
FACTORIAL_API_TOKEN are checked in that order.