CtrlK
BlogDocsLog inGet started
Tessl Logo

sonicjs-cms/sonicjs-cms

SonicJS headless CMS knowledge base, coding standards, and architectural guidelines.

93

Quality

93%

Does it follow best practices?

Impact

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

SKILL.mdskills/sonicjs-plugins/

name:
sonicjs-plugins
description:
Extends SonicJS functionality via modular plugins including Authentication (OTP, Magic Link), Editor (EasyMDE, TinyMCE, Quill), and Utility types. Use when adding, activating, building, or configuring a plugin, extension, hook, or add-on within SonicJS — including enabling passwordless auth flows, registering editor middleware, managing plugin lifecycle and dependencies, or interacting with the plugin API.

SonicJS Plugins

Adding a New Plugin @docs:plugins

  1. Navigate to Admin → Plugins and locate the plugin you want to enable.
  2. Toggle the plugin to Active.
  3. If the plugin requires a database migration, run it before using the plugin's features.
  4. Configure the plugin using the relevant section below.
  5. Verify activation: Confirm the plugin appears as Active in Admin → Plugins and that its associated UI or API endpoint responds as expected.

Configuring Passwordless Auth (OTP / Magic Link) @docs:plugins

  1. Ensure the Email Plugin is configured first — provide your provider key (Resend, SendGrid, etc.) under Admin → Plugins → Email Plugin. Requires working Email Plugin.
  2. Activate the OTP or Magic Link plugin under Admin → Plugins.
  3. Run the required migration for OTP Login:
    # Apply manually if not using automatic D1 deployment
    wrangler d1 execute <DATABASE_NAME> --file=migrations/021_add_otp_login.sql
  4. Test the flow by requesting a login link/OTP for a test user and confirming delivery.

Editor Configuration @docs:plugins

When defining a field in a content schema, set fieldType to the desired editor plugin:

{
  name: 'content',
  type: 'string',
  title: 'Content',
  // Options: 'easymde' (default), 'tinymce', 'quill'
  fieldType: 'easymde',
  required: true
}

To switch editors:

  1. Activate the desired editor plugin (TinyMCE or Quill) in Admin → Plugins.
  2. Run the TinyMCE migration if applicable:
    wrangler d1 execute <DATABASE_NAME> --file=migrations/022_add_tinymce_plugin.sql
  3. Update the fieldType value in your schema to tinymce or quill.

Database Migrations for Plugins @docs:database

Some plugins require specific migrations before they are functional:

PluginMigration File
OTP Login021_add_otp_login.sql
TinyMCE022_add_tinymce_plugin.sql

Migrations run automatically on D1 deployment. For manual deployments, apply them with wrangler d1 execute as shown above.

Core Plugins (Always Active) @docs:plugins

  • Database Tools: Browse tables, execute SQL, export data — Admin → Tools → Database
  • Email Plugin: Required for all passwordless auth workflows — Admin → Plugins → Email Plugin
  • Seed Data: Generate sample content and users — Admin → Tools → Seed Data

skills

sonicjs-plugins

tile.json