0.0.1
Initial Release
A type-safe environment variable management system for Swift applications.
Features
- Type-safe access: Convert environment variables to
Int,Bool,URL, andStringtypes - Required key validation: Ensure critical environment variables are present at runtime
- Layered configuration: Load from process environment, local development files, and defaults
- Dependencies integration: First-class support for Point-Free's Dependencies library
- Comprehensive testing: Includes test helpers and mock values
- Swift 6.0 compatibility with full platform support (iOS 13+, macOS 10.15+, tvOS 13+, watchOS 6+)
- Complete documentation: Inline docs and DocC catalog with guides
Installation
Add to your Package.swift:
dependencies: [
.package(url: "https://github.com/coenttb/swift-environment-variables", from: "0.0.1")
]Quick Start
import EnvironmentVariables
// Basic usage
let env = try EnvironmentVariables.live(requiredKeys: ["API_KEY"])
let apiKey: String? = env["API_KEY"]
let port: Int? = env.int("PORT")
// With Dependencies
@Dependency(\.envVars) var envSee the documentation for complete usage examples and advanced patterns.