Back to Home

Plugin Development Guide

Extend Synaptic with custom functionality using TypeScript. Learn the architecture, API, and best practices for building powerful plugins.

Architecture

The Synaptic plugin system is built on a few core components:

Creating a Plugin

A basic plugin implements the Plugin interface. Here is a minimal example:

import type { Plugin } from '../../plugins/types';

export class MyPlugin implements Plugin {
    id = 'my-plugin';
    name = 'My Plugin';
    version = '1.0.0';
    description = 'My amazing plugin for Synaptic';
    author = 'Developer',
    category = 'productivity';

    async onLoad() {
        console.log('Plugin loaded!');
    }

    async onEnable() {
        // Initialize your logic here
    }
}

Adding UI Components

Plugins can inject components into various parts of the app:

components = {
    view: MyFullPageView,      // Renders as a main view
    sidebar: MySidebarWidget,  // Renders in the sidebar
    settings: MySettingsPage   // Custom settings UI
};

Commands

Register commands to appear in the Command Palette (Cmd+K):

commands = [
    {
        id: 'say-hello',
        name: 'Say Hello',
        description: 'Prints hello to console',
        handler: () => console.log('Hello World!')
    }
];

Permissions

Plugins must request permissions in their manifest:

Example: Voice Memos

Recently added, the Voice Memos plugin demonstrates how to use the storage permission to save binary files and the write_notes permission to embed them.