Menu

Gumroad license keys in a Chrome extension, and what the API leaves to you
📰

Gumroad license keys in a Chrome extension, and what the API leaves to you

DEV Community: javascript·Keyturn Kit·8 days ago
#zWFNfGJG
#devtojavascript#devto#dev#gumroad#keyturn
Reading 0:00
15s threshold

We make Keyturn Kit, a starter for selling Chrome extensions with license keys, and just added Gumroad to it. Gumroad's license API is the simplest of the providers we support and also the one that leaves the most to you, so here are the details, whether you use our kit or not.

Turn license keys on

In Gumroad, open the product's content page, choose Insert and add a License key block. While you edit, the block shows the product's ID. Copy it, because every verify call needs it. Gumroad requires product_id for products created on or after 9 January 2023; the older product_permalink only works for older products.

Add https://api.gumroad.com/* to host_permissions in your manifest.

One endpoint, called two ways

There's a single public call, POST https://api.gumroad.com/v2/licenses/verify , with form fields:

const res = await fetch ( ' https://api.gumroad.com/v2/licenses/verify ' , { method : ' POST ' , headers : { ' Content-Type ' : ' application/x-www-form-urlencoded ' }, body : new URLSearchParams ({…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.