StaticgetGet the singleton instance of ConfigurationManager
Creates a new instance if one doesn't exist, otherwise returns the existing instance.
The singleton ConfigurationManager instance
Initialize the configuration manager with user settings
Merges user-provided configuration with default values to create a complete configuration object. This method should be called before using any other ConfigurationManager methods.
User-provided configuration options
Get the current configuration
Returns the current configuration object. Throws an error if configuration hasn't been initialized.
The current configuration object
Set the current configuration
Replaces the entire configuration object with a new one. This method completely overwrites the existing configuration.
The new configuration object
Get a read-only copy of the configuration
Returns a frozen copy of the configuration object to prevent accidental modifications.
A frozen copy of the configuration
Update a specific configuration value
Updates a single configuration property while preserving all other configuration values.
The configuration key to update
The new value for the configuration key
Get the API base URL with version
Constructs the full API URL by combining the base URL and version. Falls back to default values if configuration is not set.
The full API URL with version
Configuration Manager for the Mosaia SDK
Provides a single source of truth for configuration across the entire SDK. This prevents configuration copies and mutations, ensuring consistency.
The ConfigurationManager implements the singleton pattern to ensure that only one configuration instance exists throughout the application lifecycle.
Example
Example