Giter Club home page Giter Club logo

example-gumroad-integration's Introduction

Example Keygen + Gumroad integration

The following web app is written in Node.js and shows how to integrate Keygen and Gumroad together using Gumroad's custom delivery fulfillment method. After a buyer purchases our software, we will create a license for the new customer and redirect them to a "success" page containing their license key and a download link to our product distributed using Keygen Dist.

Note: This integration requires that you have an upgraded Gumroad account in order to use their "Custom Delivery" method.

This example application is not 100% production-ready, but it should get you 90% of the way there. You may need to add additional logging, error handling, validation, features, etc.

Running the app locally

First up, configure a few environment variables:

# Your Gumroad API credentials (available under Settings->Advanced->Create Application)
export GUMROAD_ACCESS_TOKEN="YOUR_GUMROAD_ACCESS_TOKEN"

# Keygen product token (don't share this!)
export KEYGEN_PRODUCT_TOKEN="YOUR_KEYGEN_PRODUCT_TOKEN"

# Your Keygen account ID
export KEYGEN_ACCOUNT_ID="YOUR_KEYGEN_ACCOUNT_ID"

# The Keygen product to create licenses for and which product we'll
# be delivering download links for
export KEYGEN_PRODUCT_ID="YOUR_KEYGEN_PRODUCT_ID"

# The Keygen policy to use when creating licenses for new customers
# after they successfully purchase your product
export KEYGEN_POLICY_ID="YOUR_KEYGEN_POLICY_ID"

You can either run each line above within your terminal session before starting the app, or you can add the above contents to your ~/.bashrc file and then run source ~/.bashrc after saving the file.

Next, install dependencies with yarn:

yarn

Then start the app:

yarn start

Testing redirects locally

For local development, create an ngrok tunnel:

ngrok http 8080

Next up, add the secure ngrok URL to your Gumroad product.

  1. Gumroad: add https://{YOUR_NGROK_URL}/success as the redirect URL to your "Custom Delivery" product (more info)

Testing the integration

Set up a Gumroad purchase form and create a test purchase.

Questions?

Reach out at [email protected] if you have any questions or concerns!

example-gumroad-integration's People

Contributors

ezekg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sincowle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.