You can get all the constants that have been exposed to the client using…
mx.session.getConstants();
You’ll need to find the constant by name there, probably using a filter(). When you have that, you can call the .value() method to get the value.
https://docs.mendix.com/refguide/constants#:~:text=When%20a%20constant%20is%20exposed,is%20exposed%20to%20the%20client.
Hope this helps.