> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Licensing basics

> Understand how Lerian licenses enterprise features and plugins, why they exist, and how the modular monetization model is structured.

Our source-available Core is free to use. But when it comes to monetizing enterprise features and plugins, whether developed by Lerian or our partners, we rely on a licensing system to manage access.

## Why licenses matter

***

Without licenses, we can’t **ensure payment** before usage, **tailor access** per customer, or **scale support** and commercial operations confidently.

Licensing helps us protect revenue, simplify operations, and ensure that customers get what they paid for; nothing less, nothing more.

## How Lerian monetizes

***

Lerian's business model is modular. Each product line may require a license to unlock access:

| Revenue Line                 | Description                                                                               |
| :--------------------------- | :---------------------------------------------------------------------------------------- |
| **Support**                  | Technical support + access to enterprise plugins as a bundle                              |
| **Marketplace / Plugins**    | Individual plugin licenses, billed monthly. Includes Lerian-built and third-party plugins |
| **Learning & Certification** | Courses and certifications related to Midaz and its ecosystem                             |
| **Professional Services**    | Custom consulting and project delivery                                                    |

<Note>
  Enterprise features included in the Support plan are actually plugins — but licensed as a unified bundle instead of one by one.
</Note>

## Supported licensing scenarios

***

Your plugin must support all the following use cases:

| Scenario                          | Description                                                 |
| :-------------------------------- | :---------------------------------------------------------- |
| **Community**                     | OSS-only. No license required                               |
| **Support only**                  | One global license for Lerian enterprise features           |
| **Support + Lerian plugins**      | One global license + individual licenses per Lerian plugin  |
| **Support + third-party plugins** | One global license + individual licenses per partner plugin |
| **Support + mixed plugins**       | Combined setup: Lerian + partner licenses                   |

<Danger>
  Our system must also support future SaaS models, allowing partners to license and distribute their own plugins independently.
</Danger>

## How License Manager works

***

### Powered by KeyGen

We use [KeyGen](https://keygen.sh/) to manage license keys and their lifecycle. It supports:

* License key generation
* Status control (active, expired, revoked)
* Periodic validation
* Integration with future billing workflows

Although we're currently using monthly billing cycles, our system is prepared for other intervals, such as biweekly, quarterly, or annual.

## License validation flow

***

Every plugin or enterprise feature must regularly validate its license using the official SDK **once a week**.

<Note>
  The SDK handles caching, retry logic, and graceful degradation, so you don’t need to build that logic yourself.
</Note>

### Status outcomes

| Status                                                                   | Behavior                                                          |
| :----------------------------------------------------------------------- | :---------------------------------------------------------------- |
| <Icon icon="square-check" color="green" /> **Active license**            | Full access and client in good standing.                          |
| <Icon icon="triangle-exclamation" color="#f1ba5c" /> **License expired** | Continue access (2-week grace period) and show a warning.         |
| <Icon icon="circle-minus" color="#ff0000" /> **License revoked**         | Block access after the grace period until the license is restored |

## Architecture

***

### License validation overview

<Frame>
  <img src="https://mintcdn.com/lerian-49cb71fc/vnpol-KPSESnOzn_/images/en/partners-hub/docs/license_manager_1.jpg?fit=max&auto=format&n=vnpol-KPSESnOzn_&q=85&s=89fef9f881317c48aa65dce907f2077e" alt="License Manager 1 Jp" width="1310" height="1192" data-path="images/en/partners-hub/docs/license_manager_1.jpg" />
</Frame>

Each plugin uses the **License SDK** to check if the license provided by the client is valid. Here's what happens behind the scenes:

1. The SDK sends the license key and client info to Lerian's server.
2. Lerian checks the license status:
   * Is it active?
   * Is it expired, but still within a grace period?
   * Has it been revoked?
3. The server replies with a response your plugin can use to allow, warn, or block access.
4. To improve performance, this result is stored in a local cache so it doesn’t need to check every time.

<Note>
  **What you need to do**: Include the License SDK in your plugin. It will take care of validation and caching automatically.
</Note>

### How each plugin uses licensing

<Frame>
  <img src="https://mintcdn.com/lerian-49cb71fc/vnpol-KPSESnOzn_/images/en/partners-hub/docs/license_manager_2.jpg?fit=max&auto=format&n=vnpol-KPSESnOzn_&q=85&s=86e981beaaef617e6031ebd38273916c" alt="" width="2009" height="777" data-path="images/en/partners-hub/docs/license_manager_2.jpg" />
</Frame>

Every plugin or enterprise feature — whether developed by Lerian or a partner — uses the **License SDK** to validate its license.

* Each plugin has its own license key.
* The SDK checks the license by talking to Lerian's licensing system.
* Lerian verifies that the license is valid using a secure backend (powered by KeyGen).
* In future versions, licenses will be automatically managed based on billing.

<Note>
  **What you need to do**: Add the License SDK to your plugin and make sure it calls `validateLicense()` before exposing any paid feature.
</Note>

## Benefits for partners

***

The License Manager is more than a gatekeeper; it’s a foundation for scaling responsibly and sustainably.

### Solves

* Unauthorized use of paid features
* Manual license tracking and revocation
* Legal and compliance risks

### Enables

* Transparent monetization of partner plugins
* Flexible resale and bundling models
* Configurable licensing policies: trials, renewals, tolerance windows

<Danger>
  Future versions will integrate with our billing system to automate license revocation and renewal.
</Danger>
