Api Key in Javascript


#1

Hi,

Can you access the API value in Javascript?

Thanks


#2

Yes, you can use Javascript to call the Ragic API. But you will need to be aware of the security limitations when running Javascript on user’s browser.


#3

Sorry if I was not clear, I would like to know how to get the API key value into a JavaScript variable, something like:
var appAPIKey = …;

I am currently using a global constant to get the value into a variable such as:
var appAPIKey = c_AppAPIKey_Vale; /* AppAPIKey_Vale is set as global constant */

It would be much better to not have to set a global constant.

Thanks