https://discord.umbraco.com logo
How can I read values from
# package-development
b
How can I read values from INotificationHandler in the backoffice? There used to be something like window.Umbraco.Sys.ServerVariables, is there a context that I can consume now?
j
No there isn't, but I created a concept package re-introducing it as a javascript module. Maybe you can find inspiration in there: https://marketplace.umbraco.com/package/umbraco.community.servervariables
b
gonna have a looksie and try it out
j
You could modify it to set the variables as
window.Umbraco.Sys.ServerVariables
again, but Umbraco is never going to use that. Instead, we have created configuration endpoints through the Management API to figure out the few settings we actually needed to know from the server.
Maybe you could create an API controller for your settings, too. That scales better with Backoffice load balancing.
b
j
Well great then, just install the package directly if you feel like it. I may need to bump it to .NET 10 for Umbraco 17, but it should be able to run
5 Views