Preferences on the backend?

Hi, I noticed that many extensions have Preferences schema defined in common, but never use it in node backend, always in browser , as far as I can tell. Sure enough you can’t get preferences from the container on a backend container module. What’s the idea with Preferences on the backend? Should they be explicitly passed from client to backend via a proxy? Or is there some (future) mechanism for making preferences available on the backend.

[original thread by Max Hillaert]

[Max Hillaert]

This is basically what I’m doing on the front-end:

        myServer.updateServerPreferences(this.proxyToPojo(preferences))
        preferences.onPreferenceChanged(e => {
            myServer.updateServerPreferences(this.proxyToPojo(preferences))
        })

Since preferences are per workspace and user, they ‘live’ in the scope of a frontend connection. Multiple users and workspaces can be opened with one frontend. So if you need to access preferences on the backend make sure it happens within the scope of a connection.

We usually read relevant preferences on frontend and pass them to backend services via options. You won’t be able to read preferences on backend without frontend since it is a user specific as Sven mentioned.

[Max Hillaert]

Fair enough. Thanks