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, OAuth social login
- Content Plugins - Code examples, testimonials, global variables
- Editor Plugins - Rich text and markdown editors
- Utility Plugins - Email, workflows, analytics, Stripe subscriptions, security audit, 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
OAuth / Social Login Plugin
Status: Inactive by default Version: 1.0.0-beta.1
Social login via OAuth2 providers (GitHub, Google).
Features:
- GitHub and Google OAuth2 integration
- Automatic account linking by email
- Manual account linking/unlinking
- CSRF-protected OAuth flow
Installation:
- Navigate to Admin β Plugins
- Find OAuth Providers plugin
- Click Activate
- Configure provider credentials (Client ID, Client Secret)
Usage: See Authentication - OAuth and OAuth Plugin Docs
Content Plugins
Plugins for managing specialized content types.
Code Examples Plugin
Status: Inactive by default Version: 1.0.0
Manage and display code snippets with syntax highlighting and language tagging.
Features:
- Multi-language code snippet storage
- Categorization and tagging
- API access to code examples
- Admin management interface
Usage: See Code Examples Plugin Docs
Testimonials Plugin
Status: Inactive by default Version: 1.0.0
Collect and display customer testimonials with ratings.
Features:
- Star ratings (1-5)
- Featured testimonials
- Company/role attribution
- Avatar support
Usage: See Testimonials Plugin Docs
Global Variables Plugin
Status: Inactive by default Version: 1.0.0
Define reusable content variables that can be injected into content using {variable_key} tokens.
Features:
- Dynamic content token resolution
- KV-cached variable lookups
- Admin management UI
- Programmatic API access
Usage: See Global Variables Plugin Docs
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
Usage: See Workflow Plugin Docs
Analytics Plugin
Status: Inactive by default Version: 1.0.0-beta.1
Privacy-focused, built-in website analytics.
Features:
- Page view tracking
- Visitor metrics
- Referrer tracking
- No third-party scripts required
Usage: See Analytics Plugin Docs
Security Audit Plugin
Status: Inactive by default Version: 1.0.0-beta.1
Brute-force detection, security event logging, and audit dashboard.
Features:
- Login attempt monitoring
- Automatic IP lockout on repeated failures
- Security event audit log
- Admin audit dashboard
Usage: See Security Audit Plugin Docs and Security - Audit Plugin
Turnstile Plugin
Status: Inactive by default Version: 1.0.0
Cloudflare Turnstile CAPTCHA integration for form protection.
Features:
- Bot protection for forms
- Invisible challenge mode
- Managed challenge mode
- Cloudflare integration
Usage: See Turnstile Plugin Docs
QR Generator Plugin
Status: Inactive by default Version: 1.0.0
Generate QR codes for content and custom URLs.
Features:
- Dynamic QR code generation
- Customizable size and format
- API endpoint for programmatic access
Usage: See QR Generator Plugin Docs
Redirect Management Plugin
Status: Inactive by default Version: 1.0.0
Manage URL redirects (301/302) from the admin panel.
Features:
- Permanent and temporary redirects
- Wildcard patterns
- Import/export support
- Redirect chain detection
Usage: See Redirect Management Plugin Docs
AI Search Plugin
Status: Inactive by default Version: 1.0.0-beta.1
AI-powered content search using vector embeddings.
Features:
- Semantic search across content
- Vector embedding generation
- Relevance-ranked results
Usage: See AI Search Plugin Docs
Stripe Subscriptions Plugin
Status: Inactive by default Version: 1.0.0
Accept payments and manage subscriptions with Stripe.
Features:
- Webhook processing with signature verification
- Subscription sync from Stripe API
- Webhook event log with admin UI
- Checkout session creation
- Tabbed admin dashboard (Subscriptions, Events, Settings)
Usage: See Stripe Plugin Docs
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