How do I hide sensitive parts of my JavaScript code?
How do I hide sensitive parts of my JavaScript code?
It's important to keep in mind that any secrets are the end users' secrets and not your secrets. Don't ever send your private keys to end users. You'll need to either act as a middle man between the end user and any third party, or have the third party generate user-specific tokens that only grant access to resources you have specifically allocated to that user.
If you can give some details of what the page will be doing, I may be able to help you with the general architecture of the data flow.
Keep it server side, and solve your problem without client side Javascript.
Otherwise you don't.
You can't have the user download something and then try to pretend they didn't download it. If it's that sensitive, it's gotta be server side.
By using a Nodejs backend. Mostly that's where the business logic goes.
by definition any code that is not compiled that is delivered to a client application will be less secure than code that is run completely under your control, you say it needs to be on the client side but I have to admit I have a hard time envisioning where code that is sensitive absolutely HAS to be run in the client (I mean truly sensitive, like validating that this is really your bank account, as opposed to just code you don't want others to take and use)
What is sensitive about it?