LiveKit.Config (LiveKit v0.1.1)

View Source

Configuration module for LiveKit. Handles configuration management and provides a unified interface for accessing LiveKit settings.

Summary

Functions

Returns the current configuration. It merges the following in order of precedence

Returns a validated configuration or an error.

Validates the configuration and returns :ok if valid, {:error, reason} otherwise.

Types

t()

@type t() :: %LiveKit.Config{
  api_key: String.t(),
  api_secret: String.t(),
  url: String.t()
}

Functions

get(opts \\ [])

@spec get(keyword()) :: t()

Returns the current configuration. It merges the following in order of precedence:

  1. Runtime-provided options (highest priority)
  2. Application environment
  3. Environment variables
  4. Default values (lowest priority)

get_validated(opts \\ [])

@spec get_validated(keyword()) :: {:ok, t()} | {:error, String.t()}

Returns a validated configuration or an error.

validate(config)

@spec validate(t()) :: :ok | {:error, String.t()}

Validates the configuration and returns :ok if valid, {:error, reason} otherwise.