getProductionUrl()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / getProductionUrl
Function: getProductionUrl()
Section titled “Function: getProductionUrl()”getProductionUrl(
primary,name):string
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:22882
Get a URL with production fallback
In production:
- If primary is localhost, throws error
- Returns primary if valid
In development:
- Returns primary (even if localhost)
Parameters
Section titled “Parameters”primary
Section titled “primary”string
Primary URL (may be localhost in dev)
string
Name of the config key
Returns
Section titled “Returns”string
Valid URL for the current environment
Example
Section titled “Example”const rpcEndpoint = getProductionUrl( process.env.RPC_ENDPOINT || 'http://localhost:8899', 'RPC_ENDPOINT')