Encode the environment in a variable (ie production vs staging)

The Global Merge Variable:

$Site.CurrentSiteUrl

is probably what you're after.

https://docs.skuid.com/v10.0.0/en/skuid/merge-syntax/global-merge-variables.html

You can use it in a formula field:

 {{$Site.CurrentSiteUrl}}

or in a snippet:

skuid.page.currentSiteUrl;