Runtime configuration for the Solaris client.
All values can be set via config :solaris, key: value and are read
at runtime so they work with Config.Provider and runtime.exs.
Required
:client_id— OAuth2 client ID:client_secret— OAuth2 client secret
Optional
| Key | Default | Description |
|---|---|---|
:environment | :sandbox | :sandbox or :production |
:timeout | 30_000 | HTTP receive timeout in milliseconds |
:max_retries | 3 | Retry count for 429/5xx responses |
:pool_size | 10 | Finch connection pool size |
:api_version | nil | Default Solaris-Version header |
:telemetry_prefix | [:solaris] | Telemetry event prefix |
:rate_limit_scale_ms | 1_000 | Rate limiter window in ms |
:rate_limit_limit | 100 | Max requests per window |
:webhook_secret | nil | HMAC secret for webhook signature verification |
:base_url_override | nil | Override base URL (used in tests) |
Example
# config/runtime.exs
config :solaris,
client_id: System.fetch_env!("SOLARIS_CLIENT_ID"),
client_secret: System.fetch_env!("SOLARIS_CLIENT_SECRET"),
environment: :production,
webhook_secret: System.get_env("SOLARIS_WEBHOOK_SECRET")
Summary
Functions
Returns the base API URL for the current environment.
Returns the configured client ID.
Returns the configured client secret.
Returns the configured environment atom.
Returns the current runtime config as a %Solaris.Config{} struct.
Returns the maximum retry count.
Returns the HTTP receive timeout in milliseconds.
Validates required config keys are present. Raises ArgumentError on failure.
Returns the webhook HMAC secret.
Types
@type t() :: %Solaris.Config{ api_version: String.t() | nil, base_url_override: String.t() | nil, client_id: String.t() | nil, client_secret: String.t() | nil, environment: :sandbox | :production, max_retries: non_neg_integer(), pool_size: pos_integer(), rate_limit_limit: pos_integer(), rate_limit_scale_ms: pos_integer(), telemetry_prefix: [atom()], timeout: pos_integer(), webhook_secret: String.t() | nil }
Functions
@spec base_url() :: String.t()
Returns the base API URL for the current environment.
@spec client_id() :: String.t() | nil
Returns the configured client ID.
@spec client_secret() :: String.t() | nil
Returns the configured client secret.
@spec environment() :: :sandbox | :production
Returns the configured environment atom.
@spec get() :: t()
Returns the current runtime config as a %Solaris.Config{} struct.
@spec max_retries() :: non_neg_integer()
Returns the maximum retry count.
@spec timeout() :: pos_integer()
Returns the HTTP receive timeout in milliseconds.
@spec validate!() :: :ok
Validates required config keys are present. Raises ArgumentError on failure.
Call once at application startup to surface config errors early.
@spec webhook_secret() :: String.t() | nil
Returns the webhook HMAC secret.