Plugin System

Extend SonicJS functionality with a powerful plugin architecture. Install, configure, and manage plugins through the admin interface.


Overview

SonicJS plugins provide modular functionality that can be enabled or disabled without modifying core code.

Plugin Types:

  • Core Plugins - Built-in plugins installed with SonicJS
  • Authentication Plugins - Passwordless login, OTP, magic links
  • Editor Plugins - Rich text and markdown editors
  • Utility Plugins - Email, workflows, database tools

Key Features:

πŸ”Œ

Hot-Swappable

Enable or disable plugins without restarting the server

βš™οΈ

Configurable

Each plugin has its own settings and configuration

πŸ”’

Isolated

Plugins run in isolation and cannot break core functionality

πŸ“¦

Packaged

Self-contained with routes, templates, and migrations


Core Plugins

These plugins are included with every SonicJS installation and provide essential functionality.

Database Tools Plugin

Status: Active by default Version: 1.0.0

View and manage your database directly from the admin interface.

Features:

  • Browse all database tables
  • Execute SQL queries
  • View table schemas
  • Export data

Access: Navigate to Admin β†’ Tools β†’ Database


Email Plugin

Status: Core plugin (requires configuration) Version: 1.0.0-beta.1

Send transactional emails via Resend, SendGrid, or other email services.

Features:

  • Email template management
  • Test email functionality
  • Settings persistence
  • Multiple provider support (Resend, SendGrid, SMTP)

Configuration:

  1. Navigate to Admin β†’ Plugins β†’ Email Plugin
  2. Configure your email provider:
    • Resend: Add your API key
    • SendGrid: Add your API key
    • SMTP: Configure server settings
  3. Test with "Send Test Email" button

Required for:

  • OTP Login Plugin
  • Magic Link Authentication
  • Password reset emails

Seed Data Plugin

Status: Active by default Version: 1.0.0

Generate sample data for testing and development.

Features:

  • Create demo users
  • Generate sample content
  • Populate media library
  • Configurable data size

Access: Admin β†’ Tools β†’ Seed Data


Demo Login Plugin

Status: Active in development only Version: 1.0.0

Auto-fills admin credentials on login screen for faster development.

Default Credentials:

This plugin is automatically disabled in production for security.


Authentication Plugins

Extend authentication with passwordless login methods.

OTP Login Plugin

Status: Inactive by default Version: 1.0.0-beta.1

One-time password authentication via email.

Features:

  • Configurable OTP code length (4-8 digits)
  • Code expiration (5-60 minutes, default: 10)
  • Rate limiting (default: 5 codes per hour)
  • Max verification attempts (default: 3)
  • Optional new user registration

Database Migration: 021_add_otp_login.sql

Installation:

  1. Navigate to Admin β†’ Plugins
  2. Find OTP Login plugin
  3. Click Activate
  4. Configure settings
  5. Ensure Email Plugin is configured

Usage: See Authentication - OTP Login


Magic Link Authentication

Status: Inactive by default Version: 1.0.0-beta.1

Passwordless login via email magic links.

Features:

  • One-click email authentication
  • No password required
  • Secure token-based links
  • Optional user registration

Installation:

  1. Navigate to Admin β†’ Plugins
  2. Find Magic Link Auth plugin
  3. Click Activate
  4. Ensure Email Plugin is configured

Usage: See Authentication - Magic Link


Editor Plugins

Rich text and markdown editing plugins for content fields.

EasyMDE Plugin (Markdown)

Status: Active by default Version: 1.0.0 Plugin ID: easy-mdx

Modern markdown editor with live preview and dark mode support.

Features:

  • Markdown editing with toolbar
  • Live preview pane
  • Dark mode styling
  • Working CDN support via unpkg
  • Keyboard shortcuts

Field Type: easymde or markdown

Replaced: MDXEditor plugin (due to CDN issues)

Configuration:

{
  fieldType: 'easymde',
  label: 'Content',
  required: true
}

TinyMCE Plugin

Status: Inactive by default Version: 1.0.0-beta.1

Full-featured WYSIWYG rich text editor.

Features:

  • Complete rich text editing
  • Image upload integration
  • Table support
  • Custom toolbar configuration
  • Extensive formatting options

Database Migration: 022_add_tinymce_plugin.sql

Installation:

  1. Navigate to Admin β†’ Plugins
  2. Find TinyMCE plugin
  3. Click Activate

Field Type: tinymce


Quill Editor Plugin

Status: Inactive by default Version: 1.0.0 Plugin ID: quill-editor

Modern, lightweight rich text editor.

Features:

  • Clean, minimal interface
  • Mobile-friendly
  • Customizable toolbar
  • Fast performance
  • Module-based architecture

Database Migration: 024_add_quill_editor_plugin.sql

Installation:

  1. Navigate to Admin β†’ Plugins
  2. Find Quill Editor plugin
  3. Click Activate

Field Type: quill


Utility Plugins

Additional functionality and workflow automation.

Workflow Plugin

Status: Core plugin Version: 1.0.0

Automate content workflows and approvals.

Features:

  • Content approval workflows
  • Multi-step processes
  • Automated actions
  • Notification triggers

Access: Admin β†’ Workflows


Plugin Management

Activating Plugins

  1. Navigate to Admin β†’ Plugins
  2. Browse available plugins
  3. Click Activate on desired plugin
  4. Configure plugin settings (if applicable)
  5. Plugin is immediately available

Deactivating Plugins

  1. Navigate to Admin β†’ Plugins
  2. Find active plugin
  3. Click Deactivate
  4. Plugin features are disabled (data is preserved)

Plugin Settings

Each plugin can have custom settings:

  1. Navigate to Admin β†’ Plugins
  2. Click plugin name or Settings button
  3. Configure options
  4. Click Save

Plugin Settings Persistence:

  • Settings are stored in database
  • Survive server restarts
  • Can be exported/imported

Editor Selection Guide

When choosing a rich text editor plugin, consider:

EditorBest ForSizeLearning Curve
EasyMDEMarkdown content, developersSmallLow
QuillClean UI, mobile appsMediumMedium
TinyMCEFull-featured editing, complex formattingLargeMedium

Fallback Behavior:

  • If no editor plugin is active, fields use plain textarea
  • Content is preserved when switching editors
  • Each editor stores content in compatible formats

Next Steps

Plugin Development

Create your own custom plugins

Core Plugins Reference

Detailed documentation for built-in plugins

Was this page helpful?