How to get AEM note properties from clientlibs-js?



Hi friends,

I created a note settings/hostconfiguration/jcr:content to configuration (subscription key, service host) for my site. So, I create a clientlib clientlib-config (/etc/designs/abc/clientlib-config) to config the sub scription key and service host.



apiMSubcriptionKey String value="abcxyz123"

serviceHost String value=""

config.js code in the clientlib-config

var apiMSubcriptionKey = "abcxyz123";

var url_host = window.location.protocol + "//" +;

var url_service = {

    'URL': '',

    'URL_UPLOAD_IMAGE': '/bin/uploadavatar',

    'SUB' : {

        'Ocp-Apim-Subscription-Key': apiMSubcriptionKey,

        'Authorization': !!localStorage.getItem("__USER_TOKEN")? "Bearer " + localStorage.getItem("__USER_TOKEN"): ""



In the config.js, I want to get the content value of the apiMSubcriptionKey and serviceHost from settings/hostconfiguration/jcr:content to replace the hard code in config.js.

How to do that?

Thanks & Best regards,


Accepted Solutions (1)

Accepted Solutions (1)



As long as technical challenge is concerned, you can make a call to this url  settings/hostconfiguration/jcr:content in json format and get the node data in response.

On other note, if you are planning to do this in publish/prod you may have to double check. If these are secret keys, you may want to perform these operations in backend (java).