Skip to content

License Component

The license component is used to verify if the user of your script has a valid license. This component provides functionality to check license validity before executing your script.

Usage

When implementing your script's onStart, execute, or onFinish methods, you can access the License component through the provided ComponentProvider.

fun execute(provider: ComponentProvider) {
    val license = provider.license()

    // Check if the user has a valid license
    if (license.isValid()) {
        // Execute premium functionality
        provider.logger().info("License valid, executing features")
    } else {
        // Handle case where user doesn't have a valid license
        provider.logger().warning("Valid license required to use this feature")
        return
    }
}

More Information

For detailed information about script licensing, including how to implement license checks, managing license distribution, and best practices, please refer to the Script licensing documentation page.