Skip to content

0.0.1

Choose a tag to compare

@coenttb coenttb released this 29 Jul 12:29

Initial Release

A type-safe environment variable management system for Swift applications.

Features

  • Type-safe access: Convert environment variables to Int, Bool, URL, and String types
  • 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 env

See the documentation for complete usage examples and advanced patterns.