Honestly, with any software, none of the protection methods are 100% safe from misuse. Think, for example, with even large-scale commercial programs, such as Photoshop, Windows, or OS X. Everyone has methods to try to stop people from abusing or pirating their software, and this is normal for the average user and does not allow people to simply copy their software and distribute it illegally.
However, if people really want to use the software illegally, they will find a way - they can reverse engineer it and then create a keygen or completely eliminate the piracy mechanisms.
Of course, being a scripting language, applications written using JavaScript are more susceptible to misuse because, as you pointed out, since JavaScript works on the client side, any user can easily view your JavaScript. However, for many of your clients this should not be a problem, and now it is quite common for companies to commercialize such software commercially, which use JavaScript as their main method of implementation.
There may be a few people who try to use your software incorrectly, but, as I said above, this happens in all areas of software development, and all you can do is your best thing to prevent this from happening. As you suggested, JavaScript obfuscation is a good way to make the source code less comprehensible (but there are some limitations, for example, when removing some legitimate lines of code that are not supposed to be obfuscated), but at the end of the day, you just need to remember that most people are likely to legitimately use your software in the correct manner, and that over-protecting your software will only annoy your legitimate users to try to hold back a small the number of people who can provide a workaround to any mechanism.
Alex rozanski
source share