Skip to content

validateProductionConfig()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / 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

Record<string, unknown>

Configuration object to validate (key-value pairs)

Validation options

string[]

Only validate these keys (defaults to all string values that look like URLs)

boolean

Throw in production even if localhost allowed (for critical configs)

ProductionConfigValidationResult

Validation result with errors and warnings

ProductionSafetyError if production mode and localhost URLs found

// Validates all URL-like values in config
validateProductionConfig({
rpcEndpoint: 'http://localhost:8899', // Error in production
apiUrl: 'https://api.example.com', // OK
name: 'my-app', // Ignored (not a URL)
})