Configuration / App Setting Values in JavaScript

From my JS code in Umbraco 13, I could access some configuration values exposed here:

Umbraco.Sys.ServerVariables

Is there a replacement for this in the new backoffice v14/15? Say if I’m writing a package and client side I need to know the values from app settings?

No idea myself, but I am now following this topic as I too wonder how I can access appsettings or an environment variable from the context of a custom extension web component :slight_smile:

2 Likes

No luck so far.

I’ll most likely write an API endpoint to return the section(s) I care about. I’ll try to keep this bumped every 5 days until the proper solution is found.

This isn’t directly built into Umbraco anymore. We wanted a more sharp separation between server and client. Most of the variables, that were used in the core, are now available through /configuration endpoints with small, manageable models. That is an approach that keeps your client fluid.

However, you might just want to read something from appsettings quick and dirty once in a while, so here is a shameless plug for a more or less direct plug-in for Umbraco.Sys.ServerVariables:

1 Like

Did you end up writing your own API endpoint for this?

I’m curious if you found a good example to follow or are just rolling your own?

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.