validateProductionConfig()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / validateProductionConfig
Function: validateProductionConfig()
Section titled “Function: validateProductionConfig()”validateProductionConfig(
config,options?):ProductionConfigValidationResult
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:22834
Validate configuration for production safety
In production mode:
- Throws if any URL value contains localhost
- Can be bypassed with SIP_ALLOW_LOCALHOST_IN_PROD=true
In non-production mode:
- Returns validation result without throwing
- Logs warnings for localhost URLs
Parameters
Section titled “Parameters”config
Section titled “config”Record<string, unknown>
Configuration object to validate (key-value pairs)
options?
Section titled “options?”Validation options
string[]
Only validate these keys (defaults to all string values that look like URLs)
strict?
Section titled “strict?”boolean
Throw in production even if localhost allowed (for critical configs)
Returns
Section titled “Returns”ProductionConfigValidationResult
Validation result with errors and warnings
Throws
Section titled “Throws”ProductionSafetyError if production mode and localhost URLs found
Example
Section titled “Example”// Validates all URL-like values in configvalidateProductionConfig({ rpcEndpoint: 'http://localhost:8899', // Error in production apiUrl: 'https://api.example.com', // OK name: 'my-app', // Ignored (not a URL)})