JetBrains Marketplace Help

Freemium plugins

Freemium plugins offer some features at no cost in addition to paid features. The reasons for implementing this model can be different, from helping you attract new users, or simply making some profit without going fully paid.

How does it look for users?

Users will see an explanatory note under the “Get” button that informs them about paid features.

An example of how the tag looks like

Starting from 213.* version of IDE, such plugins are marked with the “Freemium” tag and the “Install a version with limited functionality for free or activate the 30-day trial for full access” note:

Freemium tag in IDE

While they have the “Freemium” tag along with the “Paid” tag in the older IDE versions:

Freemium tag in old IDEs

How to make your plugin freemium?

  1. Submit the request and create a product code

    Please submit a request via the Apply to Marketplace form. After that, you will be contacted by our vendor success team via email with further steps. One of these steps is to create a Product Code and provide it in the reply.

  2. Prepare your plugin

    Make the following changes to your code to prepare your plugin for publishing:

    Define additional parameters

    You must define the following parameters in the plugin descriptor (plugin.xml):

    product-descriptor code="PPAIDPLUGIN" release-date="20201225" release-version="20201" optional="true"

    More information on these additional parameters can be found here.

    Please make sure the optional parameter in product-descriptor is set to true. Thanks to this optional attribute, the IDE will not check for a license on IDE startup, which allows us to install the plugin and start using it.

      Implement license method

      It is up to the plugin developers to decide exactly what functionality will be available for free and what will require a license. To do that, please use the following requestLicense method that checks if a license has been obtained when the paid functionality is called.

      public static void requestLicense(final String message) { // ensure the dialog is appeared from UI thread and in a non-modal context ApplicationManager.getApplication().invokeLater(() -> showRegisterDialog(message), ModalityState.NON_MODAL); } private static void showRegisterDialog(final String message) { final com.intellij.openapi.actionSystem.ActionManager actionManager = com.intellij.openapi.actionSystem.ActionManager.getInstance(); // first, assume we are running inside the opensource version AnAction registerAction = actionManager.getAction("RegisterPlugins"); if (registerAction == null) { // assume running inside commercial IDE distribution registerAction = actionManager.getAction("Register"); } if (registerAction != null) { registerAction.actionPerformed(AnActionEvent.createFromDataContext("", new Presentation(), asDataContext(message))); } } // This creates a DataContext providing additional information for the license UI // The "Register*" actions show the registration dialog and expect to find this additional data in the DataContext passed to the action // - productCode: the product corresponding to the passed productCode will be pre-selected in the opened dialog // - message: optional message explaining the reason why the dialog has been shown @NotNull private static DataContext asDataContext(@Nullable String message) { return dataId -> { switch (dataId) { // the same code as registered in plugin.xml, 'product-descriptor' tag case "register.product-descriptor.code" : return "PPAIDPLUGIN"; // optional message to be shown in the registration dialog that appears case "register.message" : return message; default: return null; } }; }

      If a license is not activated, the requestLicense method can open the Register dialog and prompt the user to activate the license. Alternatively, you can add a button in the menu to activate the plugin using this requestLicense method or come up with your own way of using the method.

      You can see the usage of this method in our demo plugin.

      1. Upload and Release

        The process of publishing is the same as for paid plugins. Please refer to this guide on how to upload and release your plugin.

      Last modified: 15 February 2022