Basic Usage
To read your configurations, it’s pretty straightforward, use thereadConfig function:
readConfigFromFile function returns your configuration object with full
type safety based on your schema.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
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");
readConfigFromFile function returns your configuration object with full
type safety based on your schema.
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
Was this page helpful?
