Thank you, @texnixe! Unfortunately, custom select fields are not really an option in our scenario. We’ll now use the production url on localhost. Maybe I’ll also use some redirects via .htaccess.
@jensfranke Another idea just came to me: You could use some DNS tricks to override the actual IP of the production URL when on a local network.
On *nix systems you’d add local hosts in /etc/hosts. You may have seen this before when working with local domains, i.e. mycomputer.local or my-app.dev or similar.
12.34.56.78 dev-api-url.example.com
# Override the IP for google.com
# Requests for google.com will not work, as the below IP
# doesn't serve google's site.
33.44.55.66 google.com
# Note that you'll need a second entry for www
# and any additional subdomains
33.44.55.66 google.com
33.44.55.66 www.google.com
33.44.55.66 somewhere-else.google.com
# You cannot use wildcards or globs in /etc/hosts
# Doesn't work:
33.44.55.66 *.google.com
Now when developing locally, this setting will override the IP address your machine looks up to use the API URL, where as other machines or networks without this setting will use the default IP, which usually comes from some DNS provider.
Then you wouldn’t have to worry about storing this value in Kirby; defer it to the network.
Surely this approach has some caveats, but it’s worth throwing in as an option.