I have chrome extension right now to sell i am using google groups hence the extension is not publically available until you buy
i saw gumroad https://help.gumroad.com/article/76-license-keys#cURLexample
can help but i have no idea how to use curl in js any suggestions? or any other option to sell (generate new licence key) and check in the chrome extension.
or else i have to code a custom backed the biggest downside is then i have to code the affiliate option fully custom as well
but if i can make it work with gumroad they can handle the affiliate option as well
So how to use curl in JS?
Hey @theindianappguy, I'm curious — what is the affiliate option you're looking to take advantage of in Gumroad?
Just fyi - best if you setup a simple intermediatery server because you'll run into cors issues.
hey @shash7, why would he run into CORS issues? Here's an extension that uses Gumroad's API that doesn't even have the content_security_policy field in the manifest.json: https://robwu.nl/crxviewer/?crx=https%3A%2F%2Faddons.mozilla.org%2Fen-US%2Ffirefox%2Faddon%2Fds-amazon-quick-view-ext%2F
It didn't work for me.
@theindianappguy maybe try connecting to gumroad directly. Seems to be working for some extensions.
have you implemented this before? if so can you help please
Sure, so you'll need a simple express server. That will route all your gumroad based routes to gumroad.
In your extension you'll need to add your server to the csp allowed list inside manifest.json
---
Just beware that the Gumroad license api is notoriously lacking in features. For instance, if you want to programmatically deactive/reactive a user's license key, you'll need to write your own logic on your server. Generally, you shouldn't be worried about this unless you're making heaps of sales.
Thanks a lot what do you think if i implement this myself, i mean if i am using my server why don't just create a key and save to server and check
if i am using my own server i may not use gumroad option then
yup facing the issue
There's no curl in javascript but u can use any variation of XHR, for instance, fetch would work just fine.
yep didn't know how to convert curl to be used as fetch this helped thanks for reply