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:
- Navigate to Admin β Plugins β Email Plugin
- Configure your email provider:
- Resend: Add your API key
- SendGrid: Add your API key
- SMTP: Configure server settings
- 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:
- Email: admin@sonicjs.com
- Password: sonicjs!
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:
- Navigate to Admin β Plugins
- Find OTP Login plugin
- Click Activate
- Configure settings
- 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:
- Navigate to Admin β Plugins
- Find Magic Link Auth plugin
- Click Activate
- 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:
- Navigate to Admin β Plugins
- Find TinyMCE plugin
- 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:
- Navigate to Admin β Plugins
- Find Quill Editor plugin
- 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
- Navigate to Admin β Plugins
- Browse available plugins
- Click Activate on desired plugin
- Configure plugin settings (if applicable)
- Plugin is immediately available
Deactivating Plugins
- Navigate to Admin β Plugins
- Find active plugin
- Click Deactivate
- Plugin features are disabled (data is preserved)
Plugin Settings
Each plugin can have custom settings:
- Navigate to Admin β Plugins
- Click plugin name or Settings button
- Configure options
- 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:
| Editor | Best For | Size | Learning Curve |
|---|---|---|---|
| EasyMDE | Markdown content, developers | Small | Low |
| Quill | Clean UI, mobile apps | Medium | Medium |
| TinyMCE | Full-featured editing, complex formatting | Large | Medium |
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