Skip to content

Getting Started

Prerequisites

Windows OS

JS plugins can currently be developed and used only on Windows through the Logi Plugin Service. Plugins created with JS will work exclusively on Windows; support for macOS will be added in the future.

Installation

Creating a plugin

To create a sample plugin, open a command prompt in the directory you wish to manage the plugin code. From here, run the following command with your desired name of the plugin in place of the templated name:

npx @logitech/plugin-toolkit create <plugin-name-here>

Use kebab-case notation for the plugin name. A new directory should be created with the name you gave the plugin in the create command. The sample plugin will use Typescript by default. If JavaScript is preferred, add the --javascript option to the end of the command.

Building the sample plugin

Navigate to the plugin directory created in the previous step. Install the plugin dependencies by running:

npm install

After the dependencies are installed, build plugin and link it to Logi Plugin Service using the watch script:

npm run watch

The plugin should now be available to use in Logi Options+ Once the build completes, it will watch for any file changes and rebuild the plugin. It will also tell Logi Plugin Service to reload the changes. When the watch script is stopped, the plugin will be unloaded from Logi Plugin Service also. To build the plugin without watching the source files for changes, the build script can be run directly:

npm run build

The compiled plugin is available from the newly created dist directory.

Running the plugin in Logi Plugin Service

The watch script will automatically load the plugin in Logi Plugin Service. If the build script is used to create a build of the plugin, it can be loaded into Logi Plugin Service using the following command:

npm run link

This will create a symlink from the dist folder to the Logi Plugin Service installed plugins folder. Once Logi Plugin Service detects the new plugin, it will create a new node process to run the plugin. Once the plugin has started, it should display in the installed plugin list in Logi Options+. From here, you can use the plugin like any other plugin. You can assign and run actions on devices, customize actions, create profiles, etc.

If you wish to remove the linked plugin from Logi Plugin Service, run the following command:

npm run unlink

The plugin should disappear from Logi Options+.

Building a distributable package

To run a minified build and package the plugin to a .lplug4 format that can be installed on any device running the Logi Plugin Service, run the following command

npm run build:pack