Change link between staging and production?

I have a button that I click that opens a link. I’d like that link to be different in prod and staging. Can I access which env I’m in via JS to change the link?

1 Like

Yes! You can do {{retoolContext.environment === 'production' ? 'productionLink' : 'stagingLink'}} to access whether you are in production or staging. If you’re curious where to find the retoolContext object, you can open the panel on the left that shows all your app’s variables and scroll down to “Globals”