TypedConfig 1.0.0
dotnet add package TypedConfig --version 1.0.0
NuGet\Install-Package TypedConfig -Version 1.0.0
<PackageReference Include="TypedConfig" Version="1.0.0" />
<PackageVersion Include="TypedConfig" Version="1.0.0" />
<PackageReference Include="TypedConfig" />
paket add TypedConfig --version 1.0.0
#r "nuget: TypedConfig, 1.0.0"
#:package TypedConfig@1.0.0
#addin nuget:?package=TypedConfig&version=1.0.0
#tool nuget:?package=TypedConfig&version=1.0.0
TypedConfig
TypedConfig is a lightweight F# library for loading configuration into strongly typed records with validation.
It maps environment variables into F# record types, ensuring type safety and clear error reporting.
Features
- Load configuration into F# records using generics
- Built-in parsing for common types (
string,int,bool) - Accumulates validation errors instead of failing fast
- Environment variable source support
- Small API surface with explicit
Result-based errors
Requirements
- .NET 10 SDK
- Paket for dependency restore
Example
open TypedConfig
type Config =
{
DATABASE_URL: string
PORT: int
DEBUG: bool
}
let result =
Api.load<Config> ()
If all required environment variables are present and valid, the result is:
Ok {
DATABASE_URL = "localhost"
PORT = 5000
DEBUG = true
}
or
Error [
MissingVariable "DATABASE_URL"
InvalidValue ("PORT", "abc", "int")
UnsupportedType "DateTime"
]
Supported Types
TypedConfig currently supports these record field types:
stringintbool
Unsupported field types return an UnsupportedType error.
Development
dotnet build
dotnet test
NuGet Packaging and Publishing
Package metadata is defined in TypedConfig/TypedConfig.fsproj for SDK-style packing.
Publishing is automated by GitHub Actions via .github/workflows/nuget-publish.yml.
Release flow:
- Ensure GitHub secret
NUGET_API_KEYis configured in the repository settings. - Create and push a version tag in format
*.*.*(for example0.1.0). - Workflow restores, builds, tests, packs, and publishes the package to NuGet.org.
Example:
git tag 0.1.0
git push origin 0.1.0
The repository uses Paket files:
paket.dependenciespaket.lockTypedConfig/paket.referencesTypedConfig.Tests/paket.references
Motivation
TypedConfig helps eliminate boilerplate configuration code and runtime errors caused by missing or invalid values, while keeping the API simple and idiomatic for F# developers.
Status
Early stage. API may change. Planned future extensions include additional sources, optional fields, custom field names, enum parsing, and nested records.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FSharp.Core (>= 10.1.300)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 83 | 5/31/2026 |