JUCE Module

This guide will get you all set up with our JUCE module to integrate the licensing part of Moonbase into your JUCE based apps & plugins.

The module is compatible with any JUCE supported platform including Androind and iOS, and has been tested on both macOS and Windows targets. It is an opinionated module, which means it comes with a default approach to handling licensing, and supports:

  • Browser based activations
  • Time-based trials
  • Offline license activations
  • Customer authentication
  • Automatic license re-validations
  • Grace period handling

Additionally, it also provides utilities to get license details in case you want to embed in your own UI.

Getting started

1. Clone module into your preferred module location

We suggest adding the module as a submodule to your project using

$ git submodule add https://github.com/Moonbase-sh/moonbase_JUCEClient

If you prefer to keep your modules locally and separate from your projects use

$ git clone https://github.com/Moonbase-sh/moonbase_JUCEClient

2. Add module to your .jucer project

Open your .jucer project file and add the module to your project by clicking on the "Add module" button and selecting the moonbase_JUCEClient folder.

3. Add module configuration

Add your moonbase_api_config.json file to your .jucer project, this config file can be downloaded in the Implementation guide for products in the Moonbase admin app, and contains all relevant cryptography keys and endpoints the module needs.

4. Add implementations to your project

Depending on if you are building JUCE plugins or apps, there are slightly different approaches you can take to implementing the module, see below for more instructions.

Implementing in plugins

Using our proprietary JUCE module, we've built the below demo for JUCE plugins. The sample contains all the code you might need to use to get started with Moonbase, and is a fully functional implementation.

Demo of the Moonbase JUCE module for plugins

Implementing in apps

Using our proprietary JUCE module, we've built the below demo for JUCE apps. The sample contains all the code you might need to use to get started with Moonbase, and is a fully functional implementation.

Demo of the Moonbase JUCE module for apps

Features

The module provides a number of features you will probably need at some point or another:

Unique Device IDs

Using JUCE, the module generates unique device fingerprints used for issuing licenses to the specific device.

Persisted license tokens

The module uses a license file to store the license information. This file is stored in the user's application data directory, and is adjustable. When re-starting your app, a check is made to see if the license needs to be re-validated, with a configurable grace period after which the product is automatically deactivated.

Activation flows

The module offers various ways to activate and deactivate the product. The included ActivationUI component implements the Auto Activation, Deactivation and Offline Activation flows and you won't need to implement anything yourself.

If you provide your own UI solution, you can additionally opt to use the Online Activation method, which utilizes a more classic username/password flow.

For more information on the possible flows, see Activation flows.

Was this page helpful?