Giter Site home page Giter Site logo

bermanboris / example-electron-license-activation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keygen-sh/example-electron-license-activation

0.0 1.0 0.0 205 KB

An example of how to implement software licensing and device activation in an Electron application

Home Page: https://keygen.sh

License: MIT License

JavaScript 74.96% SCSS 22.31% HTML 2.73%

example-electron-license-activation's Introduction

Example Electron License Manager

A minimal Electron v12 + React v17 app built with Parcel, showcasing how to implement an in-app software licensing portal with the following functionality:

  1. License key validation
  2. Device fingerprinting and activation
  3. Device management

image

Configuring a license policy

Visit your dashboard and create a new policy with the following attributes:

{
  "requireFingerprintScope": true,
  "maxMachines": 5,
  "concurrent": false,
  "floating": true,
  "strict": true
}

The maxMachines value can be whatever you prefer. The example should also work for a non-floating policy.

Creating an activation token

In order to allow a license to perform machine activations and deactivations, you will need to create a new activation token. Activation tokens allow a limited number of machine activations for a single license, which make them ideal for performing activations from a client-side environment.

⚠️ This example assumes that, once created, the activation token be added into the license's metadata attribute under the token key: ⚠️

{
  "metadata": {
    "token": "activ-abc8f8323c680b93082fc5fdb3abcb31v3"
  }
}

We're doing this so that the end-user does not need to worry about entering the activation token, or that it even exists. Alternatively, you could adjust the code to prompt the user for this value, similary to how we're already prompting for their license key.

Running the example

First up, configure a couple environment variables:

# Your Keygen account ID
export KEYGEN_ACCOUNT_ID="YOUR_KEYGEN_ACCOUNT_ID"

These environment variables will be automatically inlined into the application's source code during the build process. You can either run each line above within your terminal session before building 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 in dev mode:

yarn dev

Building and packaging

To build the app:

yarn build

To run the latest build:

yarn start

To package the app:

yarn dist

Questions?

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

example-electron-license-activation's People

Contributors

ezekg avatar

Watchers

 avatar

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.