Socket
Socket
Sign inDemoInstall

electron-gumroad-license

Package Overview
Dependencies
64
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    electron-gumroad-license

Check, store, and manage your users' Gumroad license


Version published
Weekly downloads
5
increased by400%
Maintainers
1
Install size
56.0 MB
Created
Weekly downloads
 

Readme

Source

Electron Gumroad License

NPM Package

This library allows you to verify and store a user's license for your Electron app with Gumroad's API.

A valid license is automatically stored in a local file that's encrypted with a key unique to the user's computer. While this doesn't prevent cracking a license, it makes it more difficult to copy a license file to another computer.

Getting Started

To use this library, create a new licenseManager with the ID of your Gumroad product. You can then use it to check the current license, validate a new one, and more:

import { createLicenseManager } from "electron-gumroad-license";

const licenseManager = createLicenseManager("product-id");

// Verify a license key and store it if it's valid
await licenseManager.addLicense("license-key");

// Check whether a local license exists and if it's valid
await licenseManager.checkCurrentLicense();

Options

In addition to the product ID, you can pass an option object to the licenseManager. The following values can be set:

const options = {
  /** Specifies how many times a single license code can be activated. Default: unlimited. */
  maxUses: number;
  /** Specifies how many days a license stays valid without being validated. Default: unlimited. */
  maxDaysBetweenChecks: number;
  /** Overrides Gumroad's default API endpoint for verifying licenses. */
  gumroadApiUrl: string;
  /** Disables encrypting the license key with a unique machine id. */
  disableEncryption: boolean;
}

Contributing

This package is still in its early stages. Please feel free to contribute by opening issues and submitting PRs if you feel that something could be done better.

FAQs

Last updated on 16 Nov 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc