Documentation Index
Fetch the complete documentation index at: https://docs.typeconf.dev/llms.txt
Use this file to discover all available pages before exploring further.
Once you have defined your configuration schema and values, you can read them in
your application. TypeConf provides a simple and type-safe way to access your
configurations.
Basic Usage
To read your configurations, it’s pretty straightforward, use the readConfig function:
import { ConfigType } from "your-config-package";
import { readConfig } from "@typeconf/sdk";
// Path to your config without extension
const config: ConfigType = readConfig("path/to/config-dir/my-params");
The readConfigFromFile function returns your configuration object with full
type safety based on your schema.
Type Safety
One of TypeConf’s key features is complete type safety. Your IDE will provide
full autocomplete and type checking:
const config: ConfigType = readConfig("path/to/config-dir/my-params");
// TypeScript knows the exact type of your config
config.database.host; // ✅ Type safe
config.nonexistent; // ❌ TypeScript error
Using with Different Frameworks
TypeConf works seamlessly with various frameworks and environments. Check out our framework-specific guides: