Skip to content

getProductionUrl()

SIP Protocol API Reference v0.7.4


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

string

Primary URL (may be localhost in dev)

string

Name of the config key

string

Valid URL for the current environment

const rpcEndpoint = getProductionUrl(
process.env.RPC_ENDPOINT || 'http://localhost:8899',
'RPC_ENDPOINT'
)