Scripting

Scripting with Licentra

Once the Licentra bundle is installed and configured in your NetSuite account, developers can integrate its powerful API into their custom SuiteScripts to enforce license restrictions and manage module access directly within their applications.

See More: Licentra Wiki – Modules


Overview

The Licentra scripting integration allows you to:

  • Check feature availability in real-time during script execution
  • Enforce license restrictions at the application level
  • Provide dynamic user feedback based on subscription status
  • Control functionality based on current license state

Key Components

Licentra Library Module

The core integration is provided through the licentra_lib module, which is automatically available after bundle installation.

Primary Method

  • licentraLib.isFeatureEnabled(featureId) - Check if a specific feature is enabled

Integration Points

  • User Event Scripts
  • Client Scripts
  • Suitelets
  • Map/Reduce Scripts
  • Scheduled Scripts

Quick Start

Here's a basic example of how to integrate Licentra into your SuiteScript:

Code
/** * @NApiVersion 2.1 * @NScriptType UserEventScript * @NModuleScope SameAccount */ define( [ '/SuiteBundles/Bundle 571165/licentra_lib', // Include Licentra library ], (licentraLib) => { const featureId = 'YOUR_FEATURE_ID'; // Configure in Licentra platform const beforeLoad = (context) => { const status = licentraLib.isFeatureEnabled(featureId); if (!status.enabled) { // Handle disabled feature log.audit('Feature Disabled', status.message); return; } // Proceed with feature functionality log.debug('Feature Enabled', status.message); }; return { beforeLoad }; } );

Next Steps

Last modified on