Swift Configuration
Today, we’re pleased to announce the initial release of Swift Configuration: a new library that provides a unified approach to reading configuration in your Swift applications.
Configuration management has long been a challenge across different sources and environments. Previously, configuration in Swift had to be manually stitched together from environment variables, command-line arguments, JSON files, and external systems. Swift Configuration creates a common interface for configuration, enabling you to:
Read configuration the same way across your codebase using a single configuration reader API that’s usable from both applications and libraries.
Quickly get started with a few lines of code using built-in providers for environment variables, command-line arguments, JSON and YAML files, and in-memory values.
Build and share custom configuration providers using a public
ConfigProviderprotocol that anyone can implement and share.
It actually makes me a little sad, because Foundation has a configuration management system already:
UserDefaults. Is it really necessary to reinvent the wheel again and again?
My point is that instead of enhancing/embracing the existing system (and defaults are really flexible, e.g. an environment domain is something that is conceptually supported), something completely new and separate is created. Yes, just like logging and metrics FWIW, desktop/mobile and server are not really as different as some people tend to think either. 🙈
Swift Configuration brings a unified, type-safe approach to this problem for Swift applications and libraries. What makes this compelling isn’t just that it reads configuration files: plenty of libraries do that. It’s the clean abstraction that it introduces between how your code accesses configuration and where that configuration comes from. This separation unlocks something powerful: libraries can now accept configuration without dictating the source, making them genuinely composable across different deployment environments.
With the release of Swift Configuration 1.0, the library is production-ready to serve as a common API for reading configuration across the Swift ecosystem. Since the initial release announcement in October 2025 over 40 pull requests have been merged, and its API stability provides a foundation to unlock community integrations.
Update (2025-12-16): Lukas Valenta:
At first, I asked myself why. Then I created a small Vapor application and I understood - the current ways to set environment are not great. Or more precisely, had not been. Looking forward to implementing it!