How to develop a paid extension for VS Code? a.k.a. How to prevent users from removing the license check?

I am programming a paid extension for the VS Code marketplace. Sadly this marketplace does not integrated a payment solution. So I thought I use GitHub (marketplace) for payment and authentication.

But my problem is since VS Code extensions are practically open-source how do I prevent the users of my extension to just remove the license check and use it without payment?

I am very new to JavaScript and VS Code development. I used Kotlin/JS to write the plugin and just a thin JavaScript layer to integrate it into VS Code.

I thought maybe I can obfuscate the JavaScript layer to make it more difficult to remove the check. But this might still be too easy to bypass. Just like copy-protection in the 90s. 😉

In another project I only published part of the software and let that part download the rest once the user is authenticated. Just like Blizzard with Starcraft 2. 🙂

Unless there is another solution that I missed… How would I do this in a way so the downloaded file would be cached and still is save from sharing it with others?