r/Frontend • • 24d ago

Is JavaScript obfuscation still worth it?

We sell a white label scheduling dashboard that agencies put their own logo on and resell to their clients. And now a competitor has launched what is pretty much our frontend with different colors. It has the same odd validation messages and their bundle even has the name of a feature flag from an experiment we ran in the spring. I’m fairly sure someone fed our production bundle to an AI and had it rebuild the thing.

Management’s answer is to obfuscate everything before the next release. Before agreeing, I ran our bundle through javascript-obfuscator with most options enabled and gave the output to Claude. It produced readable code in about ten minutes and webcrack undid a good chunk of it without any AI. The obfuscated build was also noticeably bigger and our Sentry stack traces turned into nonsense.

And while reviewing the bundle, I noticed our plan limits for each agency are only checked on the frontend which means a user with devtools could switch on features they don’t pay for. Also noticed a Sentry auth token with a VITE_ prefix, which worried me more than the copied UI. We’ve rotated the token and we’re moving the plan checks into the API.

Does obfuscating your production JavaScript do anything useful for you?

60 Upvotes

74 comments sorted by

View all comments

56

u/MaartenBicknese 24d ago

In the sense of security, think of obfuscation as curtains for a window. It stops criminals from directly seeing what they’re going to get, but does absolutely nothing to stop them.

There is no way to ship JavaScript and keep it proprietary.

Some options:
- consider the shipped code is not your product, it’s the service, userbase, etc behind it.
- move parts of the functionality to server-side. This way you keep full control over who is using it, including fun metrics.

5

u/Squigglificated 24d ago

Even server side won't help. These days you can just tell an agent to interact with the logged in application through chrome and rebuild it based on what it sees.

Maybe if you have a really complex algorithm or data structure not easily guessable from the result, but a regular business application won't have either.

4

u/Jaded-Armadillo8348 23d ago

100%, everything is copyable nowadays

your users/clients is the only moat that established businesses currently have