createProductionConfig()
SIP Protocol API Reference v0.7.4
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-DXh2IGkz.d.ts:22903
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
Type Parameters
Section titled “Type Parameters”K extends string | number | symbol
Parameters
Section titled “Parameters”K
envValue?
Section titled “envValue?”string
Returns
Section titled “Returns”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)