How to differentiate between Dev and Live site?

Since the WixUser functionality is working only in live site, I would like to know if there is a JS code I can use to detect which site the JS is currently running, Dev or Live environemnt…

You can use the wix-window API and check the viewMode:

https://www.wix.com/code/reference/wix-window.html#viewMode

Thanks a lot!