Configures the smart config module with async dependency injection.
SmartConfigService
Core Methods
get<T = any>(key: string, defaultValue?: T): T
Retrieves configuration value by key
Parameters: key - Configuration key, defaultValue - Fallback value
Returns: Configuration value or default
getOrThrow<T = any>(key: string): T
Gets configuration value or throws error if not found
Parameters: key - Configuration key
Throws: Error if key not found
getDatabaseConfig(): DatabaseConfig
Returns typed database configuration
Returns: Complete database configuration object
getAuthConfig(): AuthConfig
Returns authentication configuration
Returns: Authentication settings with type safety
getNetworkConfig(): NetworkConfig
Returns network and blockchain configuration
Returns: Network configuration for all supported chains
Guides
Environment Configuration Guide
Learn how to set up environment-specific configurations and secrets. Configure validation schemas, environment variable management, and secure credential handling.
Dynamic Updates Guide
Implement runtime configuration updates and hot reloading. Set up configuration watchers, event-driven updates, and real-time configuration management.
Validation Guide
Set up configuration validation schemas and type safety. Implement Joi validation, custom validators, and configuration error handling.
Examples
Complete Module Configuration
Environment-Specific Configuration
Dynamic Configuration Updates
Configuration Validation Service
Integration
Required Dependencies
Environment File Structure
Production Environment
βοΈ Type Safety: Full TypeScript support with configuration interfaces and validation.
π Security: Encrypted credential storage and environment-based configuration isolation.
π Dynamic: Runtime configuration updates with validation and event emission.