XerahS

Plugin Architecture

Plugin-Based Architecture

XerahS features a modular, plugin-based architecture for upload destinations, enabling the community to easily extend functionality without modifying the core codebase.

Overview

Unlike ShareX, where all uploaders are compiled into the main application, XerahS isolates destinations into standalone plugins. This ensures:

  • Modularity: Users only install what they need, keeping the base application lightweight.
  • Stability: Issues in a single plugin (like Imgur or S3) do not crash the main application.
  • Updates: Plugins can be updated independently of the main XerahS version.

The .sxadp Package System

Plugins are distributed as .sxadp (ShareX Avalonia Plugin) files. These are essentially ZIP archives containing:

  • Assembly DLL: The compiled C# code implementing the IUploader interface.
  • Manifest (plugin.json): Defining metadata like Name, Version, Author, and unique Plugin ID.
  • Resources: Any icons or assets required by the plugin.

Installation

Installing a plugin is simple:

  1. Download the .sxadp file.
  2. Navigate to Application Settings -> Uploaders.
  3. Click Install Plugin... and select the file.

The system validates the manifest and API version compatibility before installing it to the `Plugins/` directory.

Development

Developers can create their own plugins by referencing the XerahS.Core library and implementing the IUploader interface. The API provides:

  • Authentication Helpers: OAuth2 and API key management.
  • Result Handling: Simplified methods to return URLs, direct links, or error messages.
  • UI Integration: Automatically generated settings UI based on property attributes.