As of 9/18/2025 Highl1te Development has been paused indefinitely A template repository for creating plugins for the HighLite client. This template showcases the basic structure, lifecycle methods, and how to use static resources like HTML, CSS, images, and audio files.
π This is a Template Repository
Use this template to quickly create your own HighLite plugin by clicking the "Use this template" button on GitHub, or generate a new repository from this template.
- Node.js (v22 or higher recommended)
- Yarn package manager (v4.9.1 or compatible)
- Use this template: Click the "Use this template" button on GitHub to create a new repository based on this template
- Clone your new repository:
git clone https://github.com/YOUR_USERNAME/YOUR_PLUGIN_NAME.git cd YOUR_PLUGIN_NAME - Install dependencies:
yarn installTo build the plugin in development mode with file watching:
yarn devTo build the plugin for production:
yarn buildThe built plugin will be available in the dist/ directory as ExamplePlugin.js.
Example-Plugin/
βββ src/
β βββ ExamplePlugin.ts # Main plugin class
β βββ types.d.ts # TypeScript type declarations for static resources
βββ resources/
β βββ css/
β β βββ base.css # Stylesheet for the plugin
β βββ html/
β β βββ html.html # HTML template
β βββ images/
β β βββ image.png # Example image asset
β βββ sounds/
β βββ sound.mp3 # Exammple audio asset
βββ package.json # Project configuration and dependencies
βββ rollup.config.mjs # Build configuration
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
The main plugin class extends the base Plugin class from @highlite/plugin-api:
class ExamplePlugin extends Plugin {
pluginName = "ExamplePlugin";
author: string = "Your Name"; // Update this with your name
// Plugin lifecycle methods
init(): void { }
start(): void { }
stop(): void { }
}The plugin uses Rollup for bundling with the following features:
- TypeScript compilation - Transpiles TypeScript to JavaScript
- Static resource inlining - HTML and CSS files are bundled as strings
- Asset handling - Images and audio files are inlined (with size limits)
- ES Module output - Modern module format for compatibility
Key configuration options in rollup.config.mjs:
- Image files: Inlined up to 1MB
- Audio files: Inlined up to 5MB
- HTML/CSS: Always inlined as strings
This example demonstrates how to import and use various types of static resources:
import htmlContent from "../resources/html/html.html";
// Use in your plugin
document.getElementById("app")!.innerHTML = htmlContent;import styles from "../resources/css/base.css";
// Inject styles into the document
const styleElement = document.createElement('style');
styleElement.textContent = styles;
document.head.appendChild(styleElement);import imageSrc from "../resources/images/image.png";
// Use the image source
const img = document.createElement('img');
img.src = imageSrc;import audioSrc from "../resources/sounds/sound.mp3";
// Use the audio source
const audio = new Audio(audioSrc);
audio.play();The types.d.ts file provides TypeScript support for importing static resources:
- Image formats:
.png,.jpg,.jpeg,.gif,.svg,.webp - Audio formats:
.mp3,.wav - Web assets:
.css,.html
- Resource Management: Keep resource files organized in the
resources/directory - Debugging: Use the
this.log()method for development debugging
To customize this template for your own plugin:
- Rename your plugin: Update the
pluginNameandauthorproperties insrc/ExamplePlugin.ts - Update package.json:
- Change the
namefield to match your plugin name (e.g.,"YourPluginName") - Update the
mainfield if you rename the main TypeScript file (e.g.,"src/YourPluginName.ts") - Rerun
yarn installto make the worksapce properly recognize the new package name
- Change the
- Replace the HTML content in
resources/html/html.html - Modify styles in
resources/css/base.css - Add your own images and audio files to the respective directories
- Implement your plugin logic in the lifecycle methods
- Update this README to describe your specific plugin functionality
Testing your plugin locally is essential before publishing to the Plugin Hub. HighLite provides a convenient way to test plugins without going through the remote distribution process.
-
Clone HighLiteDesktop:
git clone https://github.com/Highl1te/HighLiteDesktop.git cd HighLiteDesktop -
Build your plugin: Navigate back to your plugin directory and build it:
cd /path/to/your/plugin yarn build -
Copy the built plugin: Copy your built plugin file to the HighLite plugins directory:
cp dist/ExamplePlugin.js /path/to/HighLiteDesktop/src/renderer/client/plugins/
- Plugin Location: Place any built plugin (e.g.,
PluginName.js) inHighliteDesktop/src/renderer/client/plugins/ - Automatic Loading: Plugins in this directory are automatically loaded by the client
- Name Conflicts: If testing an existing Plugin Hub plugin, temporarily use a different name to avoid conflicts with the remotely pulled version
- Hot Reloading: After making changes, rebuild your plugin and replace the file in the plugins directory
- Make changes to your plugin code
- Run
yarn buildto create the updated plugin file - Copy the new build to the HighLite plugins directory
- Restart HighLite to load the updated plugin
- Test your plugin functionality
- Repeat as needed
- Use
this.log()method in your plugin for debugging output - Check the HighLite console for any error messages
- Verify your plugin follows the correct lifecycle methods (
init(),start(),stop()) - Ensure all static resources are properly bundled and accessible
This project is licensed under the terms specified in the LICENSE file.