Skip to content

getProductionUrl()

SIP Protocol API Reference v0.15.1


SIP Protocol API Reference / getProductionUrl

getProductionUrl(primary, name): string

Defined in: @sip-protocol/sdk/dist/index-GLbkPPho.d.ts:23218

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'
)