createProductionConfig()
SIP Protocol API Reference v0.15.1
SIP Protocol API Reference / createProductionConfig
Function: createProductionConfig()
Section titled “Function: createProductionConfig()”createProductionConfig<
T>(defaults): <K>(key,envValue?) =>string
Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23239
Create a production-safe configuration helper
Returns a function that validates URLs and provides defaults.
Type Parameters
Section titled “Type Parameters”T extends Record<string, string>
Parameters
Section titled “Parameters”defaults
Section titled “defaults”T
Default values for non-production environments
Returns
Section titled “Returns”Configuration getter function
<K>(key, envValue?) => string
Example
Section titled “Example”const getConfig = createProductionConfig({ rpcEndpoint: 'http://localhost:8899', apiUrl: 'http://localhost:3000',})
// In dev: returns localhost// In prod: throws if env vars not setconst rpc = getConfig('rpcEndpoint', process.env.RPC_ENDPOINT)