I have been using ScriptApp.getService().getUrl() server side to return the current dev or prod (exec) url to the client side. I do this so that I can provide a "permal