Skip to content

About

Free, MIT-licensed block editor for Strapi 5: live collaboration across servers, version history, custom blocks, Media Library uploads and an optional AI assistant with your own provider.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

118 Commits

Folders and files

Repository files navigation

Magic Editor X

Magic Editor X

Block editor for Strapi 5: an Editor.js custom field with Media Library uploads, custom blocks, templates, tables with merged cells, math and footnotes, comments on blocks and on selected text with @mentions, block suggestions, version history, an audit trail, live collaboration across several servers, rendered Content API and GraphQL output, React and Vue components, and optional AI and grammar assistants that use your own provider. Free and open source under the MIT license.

npm version npm downloads CI build status License: MIT Strapi 5.38+ Documentation site

Live docs: https://schero94.github.io/Magic-Editor-X/

Contents

Getting started in 3 steps

For editors who open an entry with a Magic Editor X field for the first time:

  1. Write. Click into the field and type. Press + at the start of an empty line, or type /, to add a heading, list, image, table or any other block. Select text to make it bold, add a link or start a comment.
  2. Find the extras. Everything beyond writing is in one place: More tools above the field (Review: comments, history, quality, suggestions; Write: AI, templates, insert from another entry; View: preview, focus, shortcuts). A block's own menu (⋮⋮ next to it) moves, copies or changes that block.
  3. Save. Use Save in the Content Manager as usual. The Magic Editor X panel next to the entry shows who else is editing it, open comments and quality problems. If your browser crashes before you save, the field offers your unsaved changes back the next time you open the entry.

Features

Every feature is available in every installation. There is nothing to activate, no tiers and no usage limits. The plugin makes outgoing requests only for link previews, images and media by URL, the external link check and the AI provider and LanguageTool server the owner configured, and only when someone uses one of these features (see Security and privacy). Mention e-mails, when the owner turns them on, go through your own Strapi email plugin.

  • Custom field plugin::magic-editor-x.richtext (stored as JSON) for collection types, single types, components and dynamic zones, including localised fields and Draft & Publish.
  • Block tools (block name in brackets, the same names 1.x used):
    • text: paragraph (paragraph), heading H1 to H6 (header), list with nesting, ordered and unordered (list), checklist (checklist), quote (quote), warning (warning), alert in eight colours (alert), collapsible toggle (toggle), delimiter (delimiter), table with header row and column, alignment, merged cells and a caption (table), formula in TeX (math, 2.4);
    • structure: table of contents built from the headings, with stable anchors (toc), synced block that shows shared content edited in one place (synced, see Templates, patterns and synced blocks);
    • code: plain code (code), code with syntax highlighting and an optional file name (codeFlask; Prism with plain text, JavaScript, TypeScript, JSX, TSX, JSON, HTML/XML, CSS, SCSS, Shell, Python, PHP, Ruby, Java, Kotlin, Swift, C#, C, C++, Go, Rust, SQL, GraphQL, YAML, Markdown, Dockerfile and diff);
    • media: image upload by file or URL into the Media Library (image, with alternative text and a focal point), picking images from the Media Library (mediaLib, inserts image blocks), image by URL without upload (simpleImage), gallery of Media Library images as grid or carousel (gallery), video and audio from the Media Library with captions and WebVTT tracks (video, audio), file attachments (attaches), embeds such as YouTube, Vimeo, CodePen, GitHub, Figma and others (embed);
    • other: link preview card (linkTool), person card (personality), call-to-action button (button), raw HTML (raw).
  • Inline tools: bold, italic, link with target and rel (hyperlink, with a built-in picker that links an entry of your content types, see Internal links), mention of an entry (mention, Ctrl/Cmd+Shift+2, or type @), inline formula (inlineMath, Ctrl/Cmd+Shift+E), footnote (footnote, Ctrl/Cmd+Alt+F), marker, underline, strikethrough, inline code, tooltip, and the AI assistant when it is enabled.
  • Block tunes: alignment (alignmentTune), text variant call-out / citation / details (textVariant), indent (indentTune).
  • Field presets: per field in the Content-Type Builder: allowed blocks and heading levels, character and block limits, required alternative text, allowed links, AI and live collaboration on or off, publishing guard. Enforced on every save and over the live channel, not only in the editor. See Field presets.
  • Writing: Markdown shortcuts (#, -, 1., [], >, ```, ---, **bold**, _italic_, ~~strike~~, `code`), find and replace, keyboard shortcut help, focus mode, actions for several selected blocks, counts with reading time, a rendered preview of the field (Ctrl/Cmd+Alt+P), undo and redo, drag and drop, full screen. The field toolbar shows undo, redo, a More tools menu and full screen; everything else is in the menu. See Writing tools.
  • Templates, patterns and synced blocks: reusable starting content and block sequences per field or preset, inserted from the editor toolbar, and synced blocks that every field shows from one source. See Templates, patterns and synced blocks.
  • Comments: threads on single blocks or on selected text, with replies, resolve and reopen, @mentions of colleagues, a "Mentions and replies" widget on the admin home page and optional e-mails, for editors and read-only reviewers, with their own permissions. See Comments.
  • Suggestions: reviewers propose block changes in a separate copy of the field; editors accept or reject each one. See Suggestions.
  • Paste and import: Word, Google Docs, LibreOffice, web pages and Markdown become real blocks (tables keep merged cells, header cells and alignment; videos and audio from the web are copied into the Media Library); a CLI migrates Strapi Blocks, Markdown and HTML fields. See Paste, import and migration.
  • Media: alternative text and "decorative image" on image blocks and gallery images, a focal point that frontends keep visible when they crop; images keep their Media Library id and responsive formats.
  • Quality checks: accessibility lint (alternative texts, heading order, link texts, table headers, contrast of custom colours, videos without captions, empty tables of contents), a link check and an optional scheduled check of every external link, with an optional publishing guard. See Quality checks.
  • Renderers, schema and types: magic-editor-x/render (HTML, plain text, Markdown; framework-free and XSS-safe), React and Vue components (magic-editor-x/react, magic-editor-x/vue), guides for React, Vue/Nuxt and Astro, magic-editor-x/schema (JSON Schema) and magic-editor-x/types (TypeScript), plus npx magic-editor-x types for types of the blocks each of your fields allows. See Rendering content and TypeScript types per field.
  • Content API and GraphQL output: ?mex=html|text|markdown|json on Content API requests and <field>Rendered / <field>Resolved in GraphQL, with internal links, mentions, embedded entries, media and synced blocks resolved with the caller's permissions. See Content API and GraphQL output.
  • Custom blocks: define your own blocks in Settings: simple blocks with fields (text, textarea, URL, number, select, checkbox, image, colour) and an optional HTML template, or embedded-entry blocks that link an entry of another content type. Import and export as JSON. Blocks that need code (own editor UI, strict data rules, own output) are defined once with the block SDK; see Custom blocks in code (SDK).
  • Version history: named versions, a word-level comparison with the current content (tune changes shown as "Alignment: left → center"), restore of the whole field or a single block; automatic versions during live sessions. Fields inside repeatable components and dynamic zones have their own history (2.4). Synced block sources keep versions too.
  • Audit trail: who changed which field, version, comment, template or setting, and when, with counts and block ids but never the content. See Audit trail.
  • Live collaboration: several admins edit the same field at the same time with character-level merging, presence avatars and read-only viewers. Works with several Node processes behind a load balancer without sticky sessions.
  • AI assistant: improve, fix grammar, shorten, expand, summarize, simplify, translate, change tone and continue writing, using Anthropic, OpenAI or any OpenAI-compatible server (for example a local model) with your own key, on selected text or on chosen blocks. Optional, each behind its own owner switch: alternative text suggestions for images and translate or summarize a whole field. See AI assistant.
  • Grammar check: spelling and grammar of a whole field with a LanguageTool server (self-hosted or hosted), off until the owner turns it on. See Grammar check (LanguageTool).
  • Entry panel (2.5): a Magic Editor X panel next to every entry shows who else is editing it, open comment threads and quality problems per field; optional soft lock that asks once before you edit an entry someone else is editing. Homepage widgets "My open threads" and "Broken links".
  • Unsaved work is kept (2.5): unsaved field content stays in your browser and is offered back after a reload, crash, closed tab or ended session.
  • Reuse (2.5): insert blocks from another entry, field or language with a preview, and copy blocks between fields with everything they contain.
  • Many fields (2.5): fields start only when they come near the screen, so long entries open fast.
  • Colours from your palette (2.5): text colour and highlight from named tokens you define (no free colours, no inline styles), superscript and subscript, and inline annotations such as abbreviations. All off until a field turns them on.
  • Private upload providers (2.5): files of private storage (for example a private S3 bucket) are signed on every read and never stored signed. Drop files onto a field to upload and insert them.
  • Tools for AI clients (2.5): optional tools, preset schemas and a content guide for Strapi's MCP server.
  • Component blocks (2.6): Content-Type Builder components as blocks inside a field, with a form checked while typing and on save. Off until a field lists components. See Component blocks, columns and Live Preview (2.6).
  • Columns (2.6): 2 or 3 columns of paragraphs, headings and lists that stack on narrow screens; live editing, undo, comments, AI and every renderer included.
  • Live Preview (2.6): a click on a block in Strapi's preview opens the entry with the caret in that block; renderers can mark blocks for the preview.
  • Strapi-native admin: built with the Strapi Design System, light and dark mode, keyboard accessible, admin in English, German, French, Spanish and Portuguese.
  • Safe content: every value is normalised and sanitised on the server when it is saved, from the Content Manager, the Content API or code.
  • Strapi AI translations and Releases: Strapi's AI translation sends only the text of Magic Editor X fields and rebuilds other locales from the source structure; Releases show entries the publishing guard would refuse as not ready. See Strapi AI translations and Releases.

Screenshots

The editor in the Content Manager, light mode The editor in the Content Manager, dark mode
Live collaboration: the named cursor and selection of a second editor in the same field Version history: a comparison with the current content and restore per block
Comments panel with an open thread and its reply, and a comment marker next to a block The entry panel: who is editing now, open comments and quality per field
A columns block with a wide left column and the width toolbar A Call to action component block: a form with the component's fields inside the editor

All screenshots use synthetic data (captured on Strapi 5.61.1 and 5.62.0; acceptance host: Strapi 5.63.0). Every screen, from tables, math and footnotes to suggestions, templates and the AI assistant, is in the full gallery on the docs site.

Core concepts

Term Meaning
Field One Magic Editor X attribute of a content type or component. Its value is an Editor.js document.
Block One entry of the document's blocks array, for example a paragraph or an image. Each block has an id, a type (the block name) and data.
Custom block A block type defined in Settings > Magic Editor X > Custom blocks, or in code with the block SDK. Its name becomes the block type.
Template Starting content for a field. Inserting it replaces the field content.
Pattern A group of blocks that editors insert anywhere in a field.
Synced block Shared content edited once in Settings > Magic Editor X > Templates. A field stores only a reference ({ ref }) and shows the current source content.
Thread A comment and its replies on one block, or on a passage of text in one block, of one field, document and locale. Threads are not part of the field value.
Suggestion One proposed change of one block (changed, new or removed), waiting for an editor to accept or reject it. Suggestions are not part of the field value.
Field key A random fieldKey that a value inside a repeatable component or dynamic zone carries, so history, comments and live rooms follow that entry (2.4).
Version A stored copy (snapshot) of one field of one document in one locale, listed in the version history.
Room The live editing session of one field of one document in one locale. A room exists while people edit and for collaboration.roomTtlMinutes afterwards.
Viewer Someone in a room who can read the document but not update it. Viewers see changes live but cannot type.

Screens

Screen Where Who can open it
Editor field Content Manager, edit view Everyone who can read the field. Uploads, version history and the AI assistant need the permissions in Admin API and permissions.
Version history More tools > Version history, for a saved document access and Content Manager read on the document; saving, naming and restoring need update. The Activity tab needs audit.read.
Find and replace More tools > Find and replace, or Ctrl/Cmd+Shift+F in the editor Everyone who can read the field; replacing needs update.
Quality checks More tools > Quality checks (the number counts problems) Everyone who can read the field; the link check needs access.
Keyboard shortcuts, focus mode More tools > Keyboard shortcuts or Focus mode, or Ctrl/Cmd+Alt+/ Everyone who can read the field.
Field options Content-Type Builder, Magic Editor X field, Basic and Advanced settings Content-Type Builder access (development mode).
AI assistant Inline toolbar (select text), or a block's menu, the block selection bar or Ctrl/Cmd+Shift+G for whole blocks access and ai.use, when an administrator turned the assistant on.
AI for the whole field More tools > AI for the whole field access and ai.use, when the owner allowed whole-field AI actions and the field does not turn AI off.
Comments panel More tools > Comments (shows the open-thread count), a block's comment marker, or Comment on selected text (Ctrl/Cmd+Alt+M) access, comments.read and Content Manager read on the document; writing and mentioning need comments.write, deleting others' comments comments.moderate.
Insert template More tools > Insert template access and Content Manager read on the type; "Save content as template" and "Save as pattern" need templates.manage.
Preview More tools > Preview, or Ctrl/Cmd+Alt+P Everyone who can read the field, read-only users included.
Grammar check More tools > Check grammar access and grammar.use, when the owner turned LanguageTool on.
Suggestions panel More tools > Suggestions, a block's suggestion marker, or "Review suggestions" under the field access, suggestions.create or suggestions.review and Content Manager read; accepting and rejecting need suggestions.review and update.
Suggest mode More tools > Suggest changes, or "Suggest changes" under a field you cannot edit access, suggestions.create and Content Manager read.
Mentions and replies Widget on the admin home page access and comments.read.
Configuration Settings > Magic Editor X > Configuration settings.read (view), settings.update (edit).
Custom blocks Settings > Magic Editor X > Custom blocks custom-blocks.manage.
Templates Settings > Magic Editor X > Templates (templates, patterns and synced blocks, with versions of synced blocks) templates.manage.
Audit trail Settings > Magic Editor X > Audit trail audit.read and settings.read.

How Magic Editor X compares

Magic Editor X is free under the MIT license, and every feature below works in every installation. CKEditor 5 and TinyMCE sell collaboration, history and AI as paid plans or add-ons, and Strapi's own Blocks field has fewer block types. The table compares what each product documents. Competitor facts were checked against the linked vendor pages as of 2026-11; plans and prices change, so follow the links before you decide. "Not documented" means the vendor pages we checked say nothing either way. TinyMCE's page lists some features as included on its plan cards and as add-ons in its comparison table; this table follows the comparison table.

Feature Magic Editor X (MIT, free) CKEditor 5 (paid plans) TinyMCE (paid plans) Strapi Blocks field and Strapi plans
License and cost MIT. No plans, add-ons or usage limits. GPL 2+ for self-hosted open-source projects, or paid plans: Essential $144/month and Professional $289/month billed annually, with editor-load limits (pricing) GPL 2+ open source, or paid plans: Essential $79/month and Professional $145/month billed annually, with editor-load limits (pricing) The Blocks field is part of every Strapi edition. Content History and Strapi AI need the Growth or Enterprise plan (see below).
Real-time co-editing Yes, character-level, across several Node processes without sticky sessions Add-on to Professional ($249/month billed annually) or included in Custom (pricing) The real-time collaboration plugin was retired on 31 December 2023 (notice) Not documented
Comments on selected text Yes, with replies, @mentions and optional e-mails Add-on to Professional, or Custom (pricing) Professional and Enterprise (pricing) Not documented (Content Manager)
Suggestions and track changes Block-level only: a suggestion replaces, inserts or deletes a whole block and is accepted or rejected per block Track changes, add-on to Professional, or Custom (pricing) Suggested Edits, add-on to Professional ($79/month) or Enterprise (pricing) Not documented
Version history Named and automatic versions, word-level comparison, restore the field or one block Revision history, add-on to Professional, or Custom (pricing) Revision History, add-on to Professional or Enterprise (pricing) Content History on Growth (14 days) and Enterprise (30 to 90 days). The docs describe viewing and restoring a version, not a comparison (Content History)
AI writing help With your own key: Anthropic, OpenAI or an OpenAI-compatible server such as a local model. A fixed list of actions; no free-form prompt CKEditor AI, add-on from Essential ($133/month billed annually) (pricing) TinyMCE AI, add-on from Essential ($133/month) (pricing) Strapi AI (translations, alt text and captions in the Media Library, a Content-Type Builder assistant), included in Growth, a paid add-on on Enterprise (Strapi AI)
Tables Header row and column, alignment, merged cells, caption. Cells hold inline text only (no lists or images, because Editor.js has no nested blocks) Yes (features) Yes (plugins) No. The Blocks validator accepts paragraph, heading, quote, list, image and code (source)
Word and Google Docs content Paste from Word, Google Docs, LibreOffice and web pages into blocks. No .docx file import and no Word or PDF export Enhanced paste from Office from Essential; Import from Word from Professional; Export to Word and PDF on every plan with monthly quotas (pricing) PowerPaste from Professional; Import from Word and Export to Word or PDF as usage add-ons (pricing) Not documented
Image crop No crop inside the editor. Images keep a per-block focal point; crop in Strapi's Media Library Not documented Image Editing from Essential (pricing) The Media Library's Crop & Focus area editor crops, rotates and sets a focus area, free since Strapi 5.54 (Media Library)
Accessibility checks of the content 15 rules (alternative text, heading order, link text, table headers, contrast and more) with an optional publishing guard Not documented Accessibility Checker from Professional (pricing) Not documented

Two headless CMS editors outside Strapi, for orientation:

Product Facts as of 2026-11
Payload (Lexical editor) Multiplayer editing is announced under Payload for Enterprise but not available yet (page). The table feature is EXPERIMENTAL_TableFeature and is not on by default (features). Upload collections have a crop tool and a focal point selector in the admin (uploads).
Sanity (Portable Text) Studio has real-time multiplayer editing with character-level sync (Studio). Comments, including comments on words and sentences in Portable Text, are a Growth plan feature (Comments). Images can have crop and hotspot tools (hotspot: true) (image type).

Where Magic Editor X is weaker. These limits come from the engine, or the feature is not built yet:

  • Suggestions work on whole blocks. A reviewer cannot suggest a change to a few words inside a block, because Editor.js 2.x keeps no change marks in saved data and every block tool owns its own markup (engine decision).
  • Table cells and columns hold inline text and simple items only. Editor.js has no nested blocks.
  • There is no crop or rotate inside the editor. Crop the asset in Strapi's Media Library; the block's focal point stays with the block.
  • The AI assistant has a fixed list of actions. There is no free-form prompt and no owner-defined actions yet.
  • There is no .docx file import and no Word or PDF export. Word content comes in by paste.
  • There are no readability or SEO rules in the quality checks.
  • Behaviour on touch devices and with thousands of blocks in the browser has not been measured.

Compatibility

Plugin Strapi Node Notes
2.x 5.38 or later (CI builds and tests 5.38.0 and 5.63.0; acceptance host: Strapi 5.63.0) 22.12 or later (CI: 22, 24 and 26) SQLite, PostgreSQL and MySQL/MariaDB through the Strapi database connection. Acceptance runs used SQLite and PostgreSQL 16.
1.x 5.x 22 No longer developed.
  • engines.node is >=22.12.0 <=26.x.x (2.5 declares the floor that sanitize-html 2.18 already required since 2.4.0); the 2.3 to 2.5 test runs used Node 22.23.1.
  • The admin uses the React, React Router, react-intl, styled-components and Design System versions of the Strapi admin (React 18, Design System 2.2.4 in Strapi 5.61, 2.3.1 in 5.62 and 5.63).
  • Dropping files onto a field uses the Media Library drop zone that Strapi registers from 5.61; with an older Strapi or the legacy Media Library (useLegacyMediaLibrary) Editor.js keeps its own file drop.
  • Console messages you may see in the admin that come from Strapi itself, not from the plugin: the useRBAC deprecation warning, React Router future-flag warnings, the styled-components attribute prop warning, and the upgrade check to api.github.com when outgoing requests are blocked.
  • The editor uses Editor.js 2.31.7. Editor.js 2.32.0 is still a release candidate on npm (2.32.0-rc.3 on the next tag, checked 2026-11-12) and is not used. Why the plugin stays on Editor.js is explained in docs/engine-decision.md.
  • Formulas are rendered with Temml 0.14 (MIT), loaded by the admin only when a field shows math.
  • magic-editor-x/react works with React 18 and 19 (peer ^18.0.0 || ^19.0.0), in the browser and in server rendering, including React Server Components.
  • magic-editor-x/vue needs Vue 3.5 or later (optional peer ^3.5.0; it is never installed by the plugin).
  • magic-editor-x/render and magic-editor-x/blocks have no dependencies and no Node built-ins, so they run in Node, browsers and edge runtimes.
  • The GraphQL fields need @strapi/plugin-graphql; without it nothing is registered.

Install

npm install magic-editor-x

Enable the plugin in config/plugins.ts (or config/plugins.js):

export default ({ env }) => ({
  'magic-editor-x': {
    enabled: true,
    config: {
      // optional, see Configuration
    },
  },
});

Then rebuild the admin and restart:

npm run build
npm run develop

Add the field in the Content-Type Builder: Add another field > Custom > Magic Editor X. In its settings you can set a placeholder, a preset and the other field presets, and a minimum height (120 to 2000 px).

After the first start, Super Admins can use everything. Other roles need the plugin actions listed in Admin API and permissions (Settings > Administration Panel > Roles > Plugins > Magic Editor X).

Configuration

Reference

All keys are optional. Infrastructure options live in config/plugins; the AI provider is edited at runtime in Settings > Magic Editor X > Configuration.

Key Type Default Effect
debug boolean false Writes debug log lines (never content or personal data).
rawHtml 'sanitize' | 'allow' | 'disable' 'sanitize' Raw HTML block on save: sanitize removes scripts, event handlers, iframes and unsafe URLs; allow stores the HTML as typed; disable empties it.
sanitizeOnSave boolean true Normalise and sanitise Magic Editor X values on every Document Service write. Turning this off is not recommended.
encryptionKey string (32+ characters) unset Key for the stored AI provider key. Prefer the MAGIC_EDITOR_X_ENCRYPTION_KEY environment variable.
uploads.maxImageBytes integer 10485760 (10 MiB) Largest image accepted by file or URL (hard cap 500 MiB).
uploads.maxFileBytes integer 20971520 (20 MiB) Largest attachment.
uploads.maxMediaBytes integer 52428800 (50 MiB) Largest video or audio file copied from a pasted URL (POST /magic-editor-x/media/byUrl, 2.4; hard cap 200 MiB). WebVTT tracks are capped at 512 KiB.
uploads.allowPrivateOrigins string[] [] Exact origins (for example http://media.intranet.example.test:9000) that images and media by URL may fetch although they resolve to a private address (2.4). Redirects from them are never followed; the connection is pinned to the resolved address, and link-local and cloud metadata addresses stay refused (400), also when a listed host name resolves to them. At most 20.
linkPreview.enabled boolean true Link preview cards. When false, GET /magic-editor-x/link answers 404.
linkPreview.timeoutMs integer 8000 Time limit for fetching a page (1000 to 30000).
api.autoParseJSON boolean true Turn 1.x JSON strings of Magic Editor X fields into objects in Content API GET responses (only those fields, found by the content-type schema).
ai.allowPrivateBaseUrl boolean false Allow AI base URLs on loopback or private networks (for local models). Owner decision; not editable in the admin.
ai.apiKey string unset Provider key from the environment. When set it wins over a key stored in the settings, but only for the base URL it is configured for (ai.apiKeyBaseUrl).
ai.apiKeyBaseUrl http(s) URL unset (the official Anthropic and OpenAI APIs) Base URL the ai.apiKey key is sent to, for example https://llm.example.com for a proxy or self-hosted server. When the settings point at another base URL, the key is not sent there; an admin has to enter a key for that endpoint (it is then stored encrypted).
ai.requestsPerMinute integer 20 AI requests per admin per minute, shared by all processes.
ai.timeoutMs integer 60000 Time limit for one provider request.
ai.altText object { allowPrivateOrigins: [] } Alternative text suggestions (2.4); key below.
ai.altText.allowPrivateOrigins string[] [] Exact origins of private image storage (for example a MinIO host in your network) that alt text suggestions may read images from. One DNS lookup, pinned connection, no redirects; link-local and cloud metadata addresses are refused even when listed. At most 20, checked at startup.
languageTool.allowPrivateBaseUrl boolean false Allow a LanguageTool base URL on loopback or private networks (self-hosted server in the LAN). Owner decision.
languageTool.requestsPerMinute integer 30 Grammar checks per admin per minute, shared by all processes.
languageTool.timeoutMs integer 20000 Time limit for one LanguageTool request.
collaboration.enabled boolean true Live collaboration and its Socket.IO server.
collaboration.path string '/magic-editor-x/realtime' Socket.IO path on the Strapi HTTP server.
collaboration.allowedOrigins string[] [] Extra browser origins allowed to open the socket. The admin URL and the server URL are always allowed.
collaboration.pollIntervalMs integer 400 How often each process reads updates written by other processes (50 to 10000).
collaboration.roomTtlMinutes integer 30 Keep a room's live state this long after the last person left.
collaboration.maxMessageBytes integer 2097152 (2 MiB) Largest accepted socket message.
collaboration.snapshotIntervalMinutes integer 10 Automatic version while people edit live. 0 turns it off.
collaboration.tokenTtlSeconds integer 60 Lifetime of the one-time token that opens the socket.
collaboration.maxConnectionsPerAdmin integer 20 Open live sockets per admin across all processes.
collaboration.maxRoomsPerAdmin integer 20 Different fields one admin may have open live at the same time, across all processes.
collaboration.revalidateSeconds integer 60 Full permission re-check of open sockets. Role, permission and user changes are applied within about a second anyway.
collaboration.rateLimit object { sessionsPerMinute: 60, updatesPer10s: 300, bytesPer10s: 8388608 } Session tokens per admin and minute (shared by all processes), updates and update bytes per socket in 10 seconds.
collaboration.compaction object { enabled: true, idleSeconds: 60, minBytes: 262144, ratio: 4, checkIntervalSeconds: 30 } Rebuilds an idle room whose live state is ratio times larger than a fresh copy (and at least minBytes) as a new generation, once across all processes. Open editors switch without reconnecting; edits that had not reached the server yet are kept. Bounds: idleSeconds 15 to 86400, minBytes 1 KiB to 512 MiB, ratio 1.5 to 1000, checkIntervalSeconds 1 to 3600.
history.maxSnapshotsPerField integer 50 Versions kept per field and locale; older ones are deleted.
comments.enabled boolean true Block comments in the editor. false hides them and the comment routes answer 404.
comments.perMinute integer 30 New comments and replies one admin may post per minute, shared by all processes (1 to 1000).
comments.mentionsPerMinute integer 60 Searches of the @mention picker per admin and minute, shared by all processes (2.4).
comments.notifications object { email: false, emailPerHour: 10 } Mention e-mails (2.4); keys below. In-app notifications are always on.
comments.notifications.email boolean false E-mail people when they are mentioned, through the Strapi email plugin. The e-mail names who mentioned them and the entry, never the comment text.
comments.notifications.emailPerHour integer 10 Mention e-mails per recipient and hour.
suggestions.enabled boolean true Block suggestions (2.4). The UI appears only for roles with suggestions.create or suggestions.review, which no role has until you grant them. false hides them and the routes answer 404.
suggestions.perMinute integer 20 Times one admin may send suggestions per minute (each send carries 1 to 50 block suggestions), shared by all processes.
links.urlPattern string '' href of internal links, for example '/{locale}/{collection}/{slug}' or 'https://www.example.com/{collection}/{documentId}'. Placeholders: {documentId}, {locale}, {slug}, {collection}, {singular}. Empty means '/{collection}/{documentId}'. See Internal links.
qualityChecks.externalLinks object { enabled: false, timeoutMs: 5000, perMinute: 30 } External link check of the quality panel; keys below.
qualityChecks.externalLinks.enabled boolean false Lets the quality panel check external links (outgoing requests through the SSRF-protected fetcher; owner opt-in).
qualityChecks.externalLinks.timeoutMs integer 5000 Time limit per request and per redirect hop (1000 to 15000).
qualityChecks.externalLinks.perMinute integer 30 External URLs one admin may check per minute, shared by all processes.
qualityChecks.externalLinks.allowPrivateOrigins string[] [] Exact origins (for example an intranet host) that the link checks may reach although they resolve to a private address. Redirects from them are never followed.
qualityChecks.externalLinks.schedule object { enabled: false, rule: '0 3 * * *', maxUrlsPerRun: 500, perMinute: 60, perHostConcurrency: 2 } Scheduled check of every external link in all editor fields (needs externalLinks.enabled); keys below.
qualityChecks.externalLinks.schedule.enabled boolean false Runs the scheduled check. One process in a cluster runs each check (lease).
qualityChecks.externalLinks.schedule.rule string '0 3 * * *' Cron rule (in schedule.tz, else server time).
qualityChecks.externalLinks.schedule.tz string unset IANA time zone of the rule, for example 'Europe/Berlin' (2.4). Checked at startup.
qualityChecks.externalLinks.schedule.maxUrlsPerRun integer 500 Distinct URLs checked per run (1 to 10000).
qualityChecks.externalLinks.schedule.perMinute integer 60 Requests per minute for the whole run (1 to 600).
qualityChecks.externalLinks.schedule.perHostConcurrency integer 2 Requests in flight per host (1 to 8).
audit.enabled boolean true Records the audit trail (2.4). It holds no content. false stops recording and the extra reads it needs.
audit.retentionDays integer 180 Days an audit event is kept (0 keeps everything, at most 3660). One process prunes once an hour.
presence.enabled boolean true The Magic Editor X entry panel shows who else has the entry open (2.5). Names only, never e-mail addresses. Works without live collaboration.
presence.softLock boolean false Asks once per tab before you edit an entry someone else is editing ("Continue editing"). Never blocks anyone (2.5).
presence.perMinute integer 30 Presence requests per admin per minute, shared by all processes.
mcp.enabled boolean false Registers the Magic Editor X tools, preset schemas and content guide with Strapi's MCP server. Strapi's own server.mcp.enabled must be on too (2.5).
coreBlocks.enabled boolean false Core Blocks bridge: custom block types registered with service('core-blocks').register() pass Strapi's validation of the core Blocks field. The Settings switch overrides it once saved; turns itself off when Strapi supports custom blocks (2.7).
reuse.enabled boolean true "Insert from another entry" in More tools > Write (2.5).
reuse.perMinute integer 60 Requests of "Insert from another entry" per admin per minute.
palette.colors { name, label, light, dark }[] [] Named text colours editors may pick in fields with "Text colour and highlight" (2.5). name becomes the class mex-color-<name>; light/dark are hex colours for the editor display and the contrast check. At most 24.
palette.highlights { name, label, light, dark }[] [] Named highlight colours (<mark>, class mex-highlight-<name>), same rules (2.5). Optional palette.background and palette.text ({ light, dark }) set the page colours the contrast check compares with.
drafts.enabled boolean true Keeps unsaved field content in the admin's browser (IndexedDB) and offers it back after a reload, crash, closed tab or ended session: one notice with Restore or Discard (2.5). Removed on save, discard, expiry and logout.
drafts.ttlHours integer 72 Lifetime of a local draft in hours (1 to 720).
lazyInit.enabled boolean true Starts the editor and the live room of a field only when it comes near the screen or gets focus; until then the saved content is shown (2.5).
lazyInit.marginPx integer 800 Distance above and below the screen at which a field starts (0 to 10000 CSS pixels).

The validator rejects wrong types and ranges at startup and names the key, never the value. Keys from 1.x that no longer exist are ignored with a warning; see Migrating from 1.x.

Environment variables

Name Required Default Effect
MAGIC_EDITOR_X_ENCRYPTION_KEY Only to store an AI or LanguageTool key in the settings unset 32 or more characters. Encrypts the AI provider key and the LanguageTool key (AES-256-GCM). Without it the settings page cannot store a key; you can still pass one with ai.apiKey. Generate one with node -e "console.log(require('crypto').randomBytes(32).toString('base64'))". Keep it stable: a different key makes a stored provider key unreadable, and the settings page then asks you to enter it again.

The plugin also uses Strapi's own admin.auth.secret (ADMIN_JWT_SECRET) to sign collaboration tokens. Every process of a cluster must use the same value.

AI settings (admin)

Settings > Magic Editor X > Configuration stores these values in the Strapi store:

Setting Default Range
Enabled off
Provider anthropic anthropic, openai, openai-compatible
Base URL provider default (https://api.anthropic.com, https://api.openai.com); required for openai-compatible https, or private hosts when ai.allowPrivateBaseUrl is on
Model claude-opus-5-5 (Anthropic), gpt-6-luna (OpenAI) letters, digits and ._:/@-
API key none never returned; changing the provider or base URL requires entering it again
Max input characters 8000 200 to 50000
Max output tokens 4096 64 to 16000
Send images to the AI provider (ai.allowImages) off Allows alternative text suggestions; see AI assistant
Allow whole-field AI actions (ai.allowFieldActions) off Allows translate and summarize of a whole field

The same page has a Grammar check (LanguageTool) section; see Grammar check (LanguageTool). It also shows the scheduled link check (rule, time zone, next run, last run, and Run now for admins with settings.update), the private image origins for alt text and whether mention e-mails are on, all read-only.

Live collaboration

When a document has been saved once, the editor joins the room of its field. Everyone with Content Manager read access to that document, locale and field and the collaborate action can join; people with update access can type, others watch as viewers.

How it works:

  • Conflict-free structure. The field is shared as a Yjs document in which every block has a stable id and every part of its data has its own shared type: texts merge character by character, and every table cell, list item, checklist entry, tune (alignment, text variant, indent) and custom block field is merged separately. Two people can edit different cells of one table, different items of one list, or the text and the alignment of one paragraph at the same time and both changes are kept. When two people change the same number, switch or option at the same moment, one value wins on every screen. The stored Editor.js JSON does not change.
  • Presence. Avatars with first name and last initial (never e-mail addresses), coloured carets and selections of the others in the text, a coloured marker at the block someone is editing and an "away" state after a minute without activity or when the tab is hidden. Joins and leaves are announced politely to screen readers. Colours follow the light and dark theme; the caret does not blink when reduced motion is requested.
  • Connection state in the toolbar: Connecting, Syncing, Live, Reconnecting, Offline, View only, or Live editing unavailable.
  • Offline and reconnects. You can keep typing while the connection is gone. Unsent changes are kept, sent again after the reconnect and merged with what others did meanwhile, without duplicates. Reconnects use exponential backoff with jitter and a new one-time token; waking a laptop or returning to a tab reconnects at once. Closing the tab leaves the room immediately.
  • Undo and redo (toolbar, Cmd/Ctrl+Z, Shift+Cmd/Ctrl+Z) only revert your own changes, never what others typed (the last 200 steps).
  • Saving. Changes made by others become part of your form. Save, publish and discard work as usual. Version history restores into the live room, so everyone sees the restored content. Each locale has its own room.
  • Permissions are checked when you join, re-checked within about a second when roles, permissions or users change (on every process), and every collaboration.revalidateSeconds. An admin who loses update access becomes a viewer; one who loses read access is disconnected.
  • Nothing typed is lost. Edits are stored in the database before they are confirmed. When a room is cleaned up collaboration.roomTtlMinutes after the last person left and contains edits nobody saved, a version is created first, so they can be restored from the history.

Limits:

  • A new entry that has not been saved yet has no room. A new section in a repeatable component or dynamic zone gets its room, history and comments after the entry is saved once; until then the toolbar says so.
  • Text formatting (bold, links, …) is part of the text; two people formatting the same word at the same moment can produce nested tags, which the sanitiser keeps valid.
  • Up to 5000 blocks per field (the stored-content limit); rooms above 64 MiB of history refuse further edits until they are compacted.
  • Columns: moving an item to another column (fewer columns) keeps what others type into it at the same moment; when one person deletes an item that another moves, the delete wins. Cut and paste is not a move: cutting text and pasting it into another column removes the text and adds new text, so what someone types into the cut text at that moment is not carried over.
  • After an update, editor tabs opened before it show "Reload the page to keep editing live" until they are reloaded.
  • Several processes: run one version. During a rolling deploy, rooms that a process of the previous version still serves keep their old columns layout until that process is gone.

Running several instances

Collaboration works with several Node processes and several machines that share one database, for example Railway with 2 replicas and pm2 with 4 processes each, behind a load balancer without sticky sessions. No Redis is needed.

How it works:

  • The browser connects with the WebSocket transport only. A WebSocket connection is one long-lived request, so it does not need sticky routing. Your proxy must allow WebSocket upgrades on collaboration.path (default /magic-editor-x/realtime) and send them to Strapi.
  • The session token is signed with a key derived from admin.auth.secret, so any process can accept a token issued by another one. All processes must use the same ADMIN_JWT_SECRET.
  • Every update is written to the table magic_editor_x_collab_updates before it is acknowledged. Other processes read new rows every collaboration.pollIntervalMs and send them to their own sockets.
  • Presence is stored in magic_editor_x_collab_presence with heartbeats; leases and one-time keys in magic_editor_x_locks. Seeding a room, compaction, automatic versions and cleanup each run once across all processes.
  • Every process keeps the active rooms in memory, checks every update before it is stored (only the structures the editor uses, every dependency present, every touched block valid within the content limits) and relays it.
  • Clients resynchronise their state every 20 seconds and after each reconnect, so a process restart or deploy loses nothing that was acknowledged.
  • Permission changes set a signal in magic_editor_x_locks that every process checks every second. Session, AI, link check, comment and grammar check rate limits are counted in magic_editor_x_counters, so they apply to the whole cluster.
  • Every process fires the scheduled link check; a one-time key and a lease in magic_editor_x_locks let exactly one process run it. Its results are stored in magic_editor_x_link_fields and magic_editor_x_link_urls.
  • Comments are read from the database (polled every 15 seconds while the field is visible, 8 seconds with the panel open), so they appear on every process.

The plugin creates these tables on startup. They are not content types, so Strapi's schema sync leaves them alone. Comments, templates and versions are content types of the plugin, hidden from the Content Manager.

Behind a proxy, also set server.proxy in config/server (koa: true and the number of trusted hops in maxIpsCount) so Strapi sees the real client address.

The acceptance run with several processes is described in CONTRIBUTING.md.

AI assistant

The assistant is off until an administrator turns it on in Settings > Magic Editor X > Configuration and gives it a provider:

Provider Request Default model (2026-11-11)
Anthropic POST {base}/v1/messages, headers x-api-key and anthropic-version: 2026-10-21 claude-opus-5-5
OpenAI POST {base}/v1/chat/completions, Authorization: Bearer, max_completion_tokens gpt-6-luna
OpenAI-compatible (Ollama, vLLM, LM Studio and similar) POST {base}/v1/chat/completions, optional bearer key, max_tokens none; you name the model
  • The key stays on the server. It is encrypted at rest with MAGIC_EDITOR_X_ENCRYPTION_KEY or read from ai.apiKey, and it is never sent to the browser or written to logs.
  • A key is only sent to the endpoint it is meant for. A stored key belongs to the provider and base URL it was saved with. The ai.apiKey key belongs to ai.apiKeyBaseUrl, or, when that is unset, to the official Anthropic and OpenAI APIs. Pointing the settings (or a connection test) at another base URL sends no key there until an admin enters one.
  • The selected text (with its inline formatting) and a fixed instruction are sent to the provider. Nothing else from the document is sent. The text is never logged.
  • Base URLs must be public https URLs. Loopback and private hosts are allowed only with ai.allowPrivateBaseUrl: true in config/plugins. Redirects are not followed.
  • Input is limited by "Max input characters", output by "Max output tokens". Each admin can send ai.requestsPerMinute requests per minute; the counter is shared by all processes.
  • The answer is sanitised to the inline tags the editor uses before it reaches the browser. The admin reviews the suggestion and chooses Replace selection; nothing changes before that.

AI for chosen blocks (2.4)

Select blocks and choose AI for the chosen blocks in the selection bar, or open a block's menu and choose AI assistant, to rewrite, shorten, translate or change the tone of just those blocks (Ctrl/Cmd+Shift+G opens it for the selected blocks or the block with the caret). Only their text is sent, with its inline formatting and links; block ids, types, settings, images and URLs stay in the browser. You see the changes as a word diff before you apply them, and one Undo reverts them.

  • Uses the same switch, permission (ai.use), rate limit and "Max input characters" as the assistant for selected text; it does not need "Allow whole-field AI actions". Fields with disableAi answer 403.
  • The answer must return every text it was sent, exactly once, or nothing changes (502 BAD_RESPONSE). Each text is sanitised to the inline tools the field allows, and links that were not in the original are removed. When the blocks changed while the assistant worked, the dialog says so and applies nothing.
  • Since 2.4 the assistant for selected text works the same way: the suggestion is limited to the field's inline tools, links the selection did not hold are removed, the dialog shows a word diff, and formatting the selection crossed is kept.

Alternative text and whole-field actions

Two more AI features use the same provider, key and rate limit. Each has its own switch in Settings > Magic Editor X > Configuration, off by default, with a note that says what is sent. Fields with disableAi answer 403 for both. Results are suggestions: the server never writes content.

Feature Owner switch What is sent Result
Alternative text Send images to the AI provider (ai.allowImages) One Media Library image (the largest stored size with a long edge up to 1568 px and at most 3.5 MB; JPEG, PNG, GIF or WebP) and the content language "Suggest alternative text" on image blocks and on every gallery image; plain text up to 150 characters that the editor reviews and uses with "Use suggestion". Needs Media Library read on the file (404 otherwise).
Translate or summarize Allow whole-field AI actions (ai.allowFieldActions) The inline text of every block in the field, with its formatting and links. Images, files and other block data are not sent More (…) > AI for the whole field. A translation is shown as a preview and replaces the texts in place (blocks, ids and settings stay; one undo step); a summary can be copied or inserted as a paragraph.
  • Local files are read only from the public/uploads folder; remote files (for example a cloud upload provider) are fetched through the same SSRF-protected fetcher as link previews. The image type is taken from the file's bytes.
  • Upload providers on a private network (for example MinIO or S3-compatible storage inside your network) need their exact origin in ai.altText.allowPrivateOrigins (2.4). The host is resolved once and the connection is pinned to that address, redirects are never followed (also not to the same origin), and link-local and cloud metadata addresses stay refused even when listed. Settings > Configuration shows the list read-only.
  • A translation must return every text it was sent, exactly once, or nothing changes (502 BAD_RESPONSE); each text is sanitised again and links that were not in the original are removed. Fields over "Max input characters" answer 413.
  • POST /magic-editor-x/ai/image/alt-text answers 503 IMAGES_DISABLED while images are off; POST /magic-editor-x/ai/field/:action answers 503 FIELD_ACTIONS_DISABLED while field actions are off.

Grammar check (LanguageTool)

Editors with grammar.use can check the spelling and grammar of a whole field with "Check grammar" in the editor toolbar. Issues are highlighted in the text; a suggested replacement is applied only when the flagged text is still there and lies in one piece of text (not across formatting or a line break). The check is not AI: disableAi does not affect it. To keep a field's text away from LanguageTool, turn on disableGrammar in its field settings: the field shows no "Check grammar" button and POST /magic-editor-x/grammar/check answers 403 for it, so nothing from it is sent.

It is off until an owner configures it in Settings > Magic Editor X > Configuration > Grammar check (LanguageTool):

Setting Default Notes
Turn on the grammar check off Nothing is sent while it is off or until an editor starts a check.
LanguageTool base URL empty Your own server or a hosted service, for example https://languagetool.example.com; requests go to <base URL>/v2/check. Public https only, unless languageTool.allowPrivateBaseUrl is on.
User name, API key empty Only for hosted accounts. The key is encrypted with MAGIC_EDITOR_X_ENCRYPTION_KEY (own key derivation), never returned, and must be entered again when the base URL or user name change.
Rules Standard Standard or Strict (level=picky, adds style rules).
  • Test LanguageTool checks a fixed sample sentence (POST /magic-editor-x/settings/language-tool/test); a test against another URL never receives the stored key.
  • What is sent: the plain text of every block in the field and the language of the content locale (en becomes en-US, de de-DE, pt pt-PT; without a locale auto). Up to 60,000 characters per check in requests of at most 20,000; longer fields answer 413. At most 500 issues are shown.
  • languageTool.requestsPerMinute limits checks per admin, shared by all processes; languageTool.timeoutMs limits one request.

Field presets

Each Magic Editor X field can have its own rules, set in the Content-Type Builder (field settings). They are stored as custom field options in the schema and enforced in three places with the same code (shared/presets.mjs): the editor offers only what the field allows, the realtime server refuses new blocks a preset does not allow, and every write (Content Manager, Content API, imports, code) is checked by the Document Service middleware.

Option (options.*) Where in the field settings Values Effect
preset Basic full (default), article, basic, minimal Allowed blocks, inline tools and heading levels, see below.
linkTargets Basic all (default), internal, external, none Which links are allowed: entries of the site (internal links), web addresses, both or none. Link blocks (linkTool, button, personality) count as web addresses.
requireAlt Basic checkbox Images need an alternative text or the "decorative image" mark.
allowedBlocks Advanced comma-separated block names, for example paragraph, header, list, image, myHero Replaces the preset's block list (custom blocks by name). paragraph is always allowed.
headingLevels Advanced 2-4, 2,3, 1, 3-5 Replaces the preset's heading levels.
maxBlocks Advanced number, empty or 0 = no limit Block limit, shown in the toolbar (12 / 20 blocks).
maxCharacters Advanced number, empty or 0 = no limit Visible characters, counted like the toolbar (380 / 400 characters).
disableAi Advanced checkbox No AI button in this field; the AI route answers 403 for requests from it.
disableGrammar Advanced checkbox No "Check grammar" button in this field; the grammar route answers 403, so its text is never sent to LanguageTool.
disableCollaboration Advanced checkbox No live editing in this field (the session route answers 403).
publishGuard Advanced checkbox Publishing is refused while the quality checks report errors in this field.
Preset Blocks Inline tools Headings
full all, custom blocks included all H1-H6
article paragraph, header, list, checklist, quote, warning, alert, toggle, code, codeFlask, delimiter, toc, synced, table, embed, image (and the Media Library picker), gallery, video, audio, linkTool, attaches, button, and code-registered blocks that list article all H2-H4
basic paragraph, header, list, quote, image, delimiter bold, italic, underline, strikethrough, link H2-H3
minimal paragraph, list bold, italic, link none

How the rules apply:

  • Editor: blocks that are not allowed leave the toolbox, the conversion menu and paste handling; heading levels and inline tools are limited; Markdown shortcuts and pasted content follow the preset (a pasted H1 becomes the nearest allowed level, a table becomes text). Existing content that no longer fits is kept, listed under "Field settings" in the quality panel with Fix automatically (changes heading levels, turns blocks that are not allowed into paragraphs, removes links that are not allowed), and a note under the field says that saving fails until it is fixed.
  • Save: a value that breaks a rule is refused with 400 ValidationError, details.code: 'PRESET_VIOLATION', details.violations: [{ field, code, blockId, index, params }] (codes BLOCK_NOT_ALLOWED, HEADING_LEVEL, LINK_NOT_ALLOWED, ALT_REQUIRED, TOO_MANY_BLOCKS, TOO_MANY_CHARACTERS) and details.errors with the field path, so the Content Manager shows the reason on the field. Errors carry rule codes and block ids only, never content. Inline formatting a preset leaves out (for example a marker in a basic field) is removed on save; the text stays.
  • Live editing: the server refuses updates that add a block type or heading level the preset does not allow (blocks that existed before stay editable). Limits and alternative texts are checked on save only, so typing is never refused half-way.

Changing a preset never changes stored content by itself. Turning sanitizeOnSave off also turns the save check off.

Writing tools

Tool How
More tools menu The field toolbar shows undo, redo, More tools and full screen. More tools groups the other tools: Review (comments, version history, suggestions, quality checks), Write (suggest changes, AI for the whole field, check grammar, find and replace, insert template) and View (preview, focus mode, keyboard shortcuts). Entries appear only where they can work (permission, settings, field options); counts show in the menu, and a tool that changes the view (preview, focus mode) adds a visible way back to the bar. Keyboard shortcuts are unchanged.
Markdown shortcuts At the start of an empty paragraph: # to ###### + Space (heading), -, * or + + Space (bulleted list), 1. + Space (numbered list, other numbers set the start), [] or [x] + Space (checklist), > + Space (quote), ``` (optionally with a language) + Enter (code block), --- + Enter (delimiter). While typing: **bold**, __bold__, *italic*, _italic_, ~~strike~~, `code`. Never inside code, raw HTML or tables; only blocks and marks the field allows.
Find and replace Magnifier button or Ctrl/Cmd+Shift+F. Searches every text block, list item, table cell, caption and code block; keeps formatting; match case, whole words, regular expressions (off by default, patterns up to 200 characters). Enter / Shift+Enter move between matches, the current match is highlighted. Replacements are normal edits (undo, collaboration). A match cannot span differently formatted text.
Keyboard shortcuts Ctrl/Cmd+Alt+/ or More > Keyboard shortcuts: editor, block and inline tool shortcuts and the Markdown shortcuts of this field. Keyboard path to blocks: Ctrl/Cmd+/ opens the block menu of the current block (move, delete, convert), / or Tab in an empty block chooses a block type, Tab and the arrow keys reach the buttons and options inside blocks, and the + and block menu handles are buttons with names.
Focus mode More > Focus mode: full screen, narrower text column, other blocks dimmed. Escape leaves.
Several selected blocks Select across blocks (Shift+Arrow at a block edge, Ctrl/Cmd+A twice, or drag across blocks): move up or down, duplicate, copy as Markdown, delete, convert to text, heading, list or quote.
Counts Blocks, words, characters and reading time (200 words per minute) in the toolbar, with the field's limits.
Alternative text Image and image-by-URL blocks and every gallery image: "Alternative text" field (prefilled from the Media Library) and "Decorative image (no alternative text)". Required when the field has requireAlt. With the AI image switch on, "Suggest alternative text" (see AI assistant).
Focal point Image blocks and gallery images: "Set focal point", then click or tap the image, or use the arrow keys (1 %, Shift for 10 %); Reset clears it. Frontends keep this point visible when they crop the image.
Mentions Type @ at the start of a word in a text block: entry suggestions open at the caret (arrow keys, Enter inserts, Tab switches the content type, Escape closes and keeps the text). An e-mail address such as name@example.test never opens it. Or select text and press the Mention button or Ctrl/Cmd+Shift+2: the internal-link picker opens with the selection as search text. The picked entry becomes a chip with its title. Backspace or Delete removes the whole chip. Offered when the field allows links to entries (linkTargets all or internal).
Table of contents Block "Table of contents": title, heading levels (from, to) and list style. The editor shows a live preview from the headings; frontends build the list when they render.
Code language The code block's language select lists 27 languages (one list for the editor, highlighting and renderers). A language the list does not have (from older or imported content) is kept and highlighted as plain text.
Code file name The highlighted code block (codeFlask) has an optional file name above the code (plain text, up to 200 characters). Renderers show it as a caption; Markdown writes it as ```js title="name". The plain code block has no file name.
Tables Header row and header column, alignment per column, merged cells and a caption. Select cells with Shift+click (or drag) and merge them, or use merge right/down and split from one cell. Tab and Shift+Tab move between cells (Tab in the last cell adds a row), Enter moves down, Shift+Enter is a line break, Alt+F10 opens the table toolbar. Pasting tab-separated text from a spreadsheet fills the cells; pasting a table from Word or a web page keeps merged cells, header cells and alignment. Tables saved before 2.4 stay exactly as they were.
Math Block "Math": TeX source, display or inline style and a live preview with parser errors. Inline formulas: select text and press Ctrl/Cmd+Shift+E, or press it at the caret. The API and the renderers output MathML (see Rendering content).
Footnotes Ctrl/Cmd+Alt+F adds a footnote at the caret and opens its note (bold, italic and links as the field allows). Notes live in their marker, so copying, moving, undo and deleting keep marker and note together. Footnotes are numbered in reading order and listed under the field (go to, edit, remove).
Preview Preview button or Ctrl/Cmd+Alt+P: the field rendered with magic-editor-x/react as a frontend would show it (code line numbers on). Embeds appear as labelled links, links do not navigate, raw HTML only when the field allows it and after a second sanitising pass. The editor stays open in the background, so collaborators' edits show up live.
Language and direction The editor gets the content locale as lang (spell checking) and writes right to left for Arabic, Hebrew, Persian, Urdu and other RTL locales.

Templates, patterns and synced blocks

Settings > Magic Editor X > Templates (permission templates.manage) holds three kinds of reusable content, each with a name, an optional description, its blocks (edited in an embedded editor), a scope and an on/off switch:

Kind Stored as In the editor
Template kind: 'template' "Insert template" replaces the field content (with a confirmation when the field is not empty; Undo brings it back).
Pattern kind: 'pattern' Inserted after the block you worked on last (or into an empty field).
Synced block kind: 'synced' Inserted as a reference. The field stores { type: 'synced', data: { ref } } and shows the current content of the source; a change to the source appears in every field that uses it.
  • Scope: every Magic Editor X field, or only fields with chosen presets and chosen fields. The "Insert template" dialog lists the enabled entries whose scope covers the field (searchable, with a preview).
  • Field rules apply: blocks the field's preset does not allow are left out, heading levels and links are fixed like "Fix automatically", maxBlocks cuts the list, and every inserted block gets a new id. The dialog says how many blocks were left out or adjusted.
  • Saving from the editor: managers can save the whole field ("Save content as template" in the dialog) or the selected blocks ("Save as pattern" in the block selection bar).
  • Limits: 1 to 200 blocks and 256 KiB per entry, at most 500 entries. Blocks are cleaned with the same sanitiser as field values on every write; raw HTML is sanitised (or emptied when rawHtml is disable), never stored as typed.

Synced blocks in detail:

  • In the editor a synced block shows "Synced block:" with the source name and the rendered source. Edit source (only with templates.manage) opens it in Settings; Detach replaces the reference with a copy of the blocks, which then become normal content of the field (one undo step). A deleted source shows "Synced block removed" and renders nothing.
  • A source cannot contain another synced block, and its kind cannot change (400). Turning a source off only stops offering it for insertion; fields that reference it keep showing it.
  • Sources have no Draft & Publish and are not localised: a saved change is live in published API output at once. Old versions of a field store the reference only, so they show the current source.
  • Settings shows how often a source is used (entries, fields, templates and patterns; GET /magic-editor-x/templates/:id/usage, counts only). The count reads the stored data, so it includes changes made through the Content API, scripts or imports; on very large sites it stops after 200,000 rows or 20 seconds and says "at least".
  • Versions of synced blocks (2.4): every save of a source keeps a version (name, blocks, who saved it). The source's edit view in Settings lists them with a preview, a comparison with the content in the form, rename and Restore (with a confirmation; restoring saves the source again as a new version). Deleting a source deletes its versions. Templates and patterns have no versions.
  • Synced blocks are offered only where the field's preset allows synced (full and article). Blocks of the source that the field does not allow are left out, and the editor says how many.
  • Without ?mex, the Content API returns the stored reference. With ?mex, GraphQL …Rendered/…Resolved or the renderers' synced option, the source blocks are expanded in place (see Content API and GraphQL output).

Comments

Reviewers and editors can discuss single blocks or a passage of text without changing the content. More tools > Comments shows the number of open threads and opens the panel; each block with open threads gets a marker at its end.

  • Start a thread on a chosen block, reply, resolve and reopen; edit or delete your own comments (deletion asks for confirmation). Resolved threads are hidden until you choose "Show resolved threads". A thread whose block was deleted stays readable and can be resolved.
  • Comments on selected text (2.4): select text and choose Comment in the inline toolbar, or press Ctrl/Cmd+Alt+M. Read-only reviewers get a floating Comment button next to the selection. Magic Editor X highlights the passage and keeps the thread on it while people edit, also during live editing (the anchor follows the text in the live room, then its quoted text). When the passage is gone the thread says "Text changed" and stays on its block. Ctrl/Cmd+Alt+N jumps to the next open comment, with Shift to the previous one. Browsers without the CSS Custom Highlight API show no highlight; threads and markers still work.
  • Mentions (2.4): type @ in a comment to mention a colleague. The list offers only people who can read the field, by name (never e-mail addresses). The server checks every mention again and drops people without access. Mentioned people, and the other people in a thread when someone replies, see it in the comments panel ("You were mentioned", "New reply") and in the Mentions and replies widget on the admin home page, which links to the thread. With comments.notifications.email: true they also get an e-mail through your Strapi email plugin (in English, at most emailPerHour per person). The e-mail names who mentioned them and the entry title when they may read it, never the comment text.
  • Comments are plain text (up to 4000 characters; control, bidi-override and zero-width characters are removed). They are never part of the field value, the version history or the Content API.
  • Permissions: comments.read to see threads and notifications (plus Content Manager read on the document, locale and field), comments.write to comment, reply, mention, resolve, reopen and edit or delete your own (no update right needed, so read-only reviewers can comment), comments.moderate to delete other people's comments or a thread with their replies.
  • New comments appear for others within about 15 seconds (8 seconds with the panel open), on every process of a cluster.
  • Limits: comments.perMinute per admin, 1000 comments per field and locale, 200 replies per thread, 20 mentions per comment, comments.mentionsPerMinute picker searches per admin.
  • Fields inside repeatable components and dynamic zones have comments since 2.4. Threads written there before 2.4 were stored by position: they move to their entry when their block proves it, otherwise they are listed read-only under "Older comments saved by position".
  • Deleting a document locale deletes its comments and notifications. Deleting an admin keeps their comments and shows them as "Deleted user", and deletes the notifications addressed to them. comments.enabled: false hides comments and the routes answer 404.

Suggestions

Give a role Suggest block changes (suggestions.create) and its members can choose Suggest changes (More tools, or the button under a field they cannot edit), even in fields they cannot edit. Their edits stay in a separate copy of the field until they send them: nothing reaches the form, the live room or other people before that. Each changed, new or removed block becomes one suggestion, with an optional note. Editors with Review block suggestions (suggestions.review) accept or reject them in the Suggestions panel (More tools > Suggestions, or a block's suggestion marker). Accepted changes go into the field like any edit, as one undo step and live for collaborators; save the entry to keep them.

  • The panel shows each suggestion as a word diff against the block as it is now, with author, time and note. A suggestion whose block changed since it was made is marked "Outdated" and asks before it replaces the newer text. Accept all accepts the suggestions that are not outdated.
  • One decision wins: when two reviewers decide the same suggestion, the second gets "Someone else already decided this suggestion" (409 ALREADY_DECIDED). Authors can withdraw their own open suggestions.
  • Suggestions are block level. Editor.js keeps no change marks in its data, so character-level track changes are not possible; moving blocks is not a suggestion. In the copy, AI, uploads, the Media Library and the footnote dialog are not available.
  • Suggested blocks are cleaned with the field's sanitiser and checked against its preset when they are sent; an accepted change is checked again when the entry is saved. At most 50 per send, 500 open per field and locale, suggestions.perMinute sends per admin.
  • Accepting needs suggestions.review and update access to the document; suggesting needs Content Manager read only. No role has either action after an update, so nothing appears until you grant them. suggestions.enabled: false turns the feature off.

Review workflows are not supported. Strapi's review workflows (stages, required stage before publishing) need a Strapi Enterprise or Growth plan: in Strapi 5.61 @strapi/review-workflows registers its routes, services and Document Service middleware only when that feature is active, so a stage change cannot be checked end to end on a Community Edition host. A hook that refuses a stage change while the quality checks fail could not be tested, so 2.4 ships none. The plugin's own publishing guard (publishGuard) and Releases readiness work without it.

Paste, import and migration

Paste. Pasting from Word, Google Docs, LibreOffice, web pages (two or more blocks) or Markdown text creates real blocks: headings, nested lists, checklists, quotes, code, tables, links, bold, italic, underline and strikethrough. Styles, classes, comments and scripts are removed; the clipboard HTML is parsed into an inert document and never attached to the page. Images from the web are copied into the Media Library through the same SSRF-protected path as "image by URL" (at most 10 per paste) when you may upload; images Word keeps on your disk (file:) cannot be pasted and are counted in a message. Since 2.4, pasted <video> and <audio> elements with an http(s) source become video and audio blocks when the field allows them and you may upload: the file, its poster and its WebVTT tracks are copied into the Media Library (POST /magic-editor-x/media/byUrl, at most 3 per paste, up to uploads.maxMediaBytes; the server checks the file's first bytes against the type). Tables keep merged cells, header cells, alignment and the caption. A flat task list becomes a checklist block; a nested one becomes a list block with the checklist style, which keeps the nesting. Markdown that nests lists or quotes more than 32 levels deep is pasted as plain text. Blocks the field does not allow become paragraphs. Ctrl/Cmd+Shift+V pastes plain text. Pastes into code, raw HTML and table cells are not changed.

Migrate an existing field. Add a Magic Editor X field next to the old one, then run from the project root (the old field is kept):

npx magic-editor-x migrate --uid api::article.article --from body --to content            # dry run, writes nothing
npx magic-editor-x migrate --uid api::article.article --from body --to content --apply    # convert

Options: --format auto|blocks|markdown|html (auto: Blocks fields as Strapi Blocks, Rich text as Markdown, text and string as HTML when they contain tags, else Markdown, JSON as Strapi Blocks or Editor.js), --locale <code> or --locale '*' (all locales), --overwrite (replace a target that already has content), --batch 50, --limit <n>, --json (machine-readable report on stdout; Strapi's own log lines go to stderr), --out report.json. Re-running skips converted documents (idempotent). The report counts scanned, converted, skipped and failed documents and lists lossy conversions (for example a skipped image, or a custom Blocks node type reported as unsupported-node; see Core Blocks bridge) by document id and note, never content. Drafts are converted; publish afterwards. The same is available in code: strapi.plugin('magic-editor-x').service('migrate').run({ uid, from, to, format, locale, dryRun, overwrite }).

Version history

The clock button opens the versions of the field (per document and locale). Save current version stores the editor content, optionally with a name ("Before legal review", up to 120 characters); the pencil renames a version. Open a version with the eye button: Preview shows it, Changes compares it with the current editor content: added, removed, moved and changed blocks, changes marked word by word (<ins>/<del> with text labels, not colour alone), formatting-only changes and tune changes in words ("Alignment: left → center", "Indent: 0 → 1"; tunes that differ only in key order are not reported). A synced block appears as "Synced block" with its source name. Restore this block puts a single block back (at its old place, or over the current block); Restore replaces the whole field. Save the entry to keep a restore. Automatic versions are taken during live sessions (collaboration.snapshotIntervalMinutes).

Since 2.4, fields inside repeatable components and dynamic zones have their own history: their values carry a fieldKey, so versions follow the entry when entries are moved, added or removed. Versions saved by position before 2.4 move to their entry when their block ids prove it; the others are listed read-only under "Older versions saved by position" (view and compare, no restore). Admins with audit.read also see an Activity tab with the field's audit trail. Editor.js writes default settings (alignment left, no indent) into every block it saves; since 2.4 these no longer count as a change, so live sessions without edits leave no new version.

Quality checks

The seal button opens the quality panel; its number counts problems. It never blocks editing.

  • Accessibility lint (shared/quality.mjs): images and gallery images without alternative text (an error when the field has requireAlt, otherwise a warning; decorative images are fine), skipped heading levels, more than one H1, empty headings, empty links (error), link texts such as "click here", "hier", "cliquez ici", "aquí", "clique aqui" (English, German, French, Spanish, Portuguese), tables without a header row or header column, empty header cells (table-empty-header, warning), formulas that do not parse (math-invalid, warning), empty footnotes (footnote-empty, warning), custom-block colour pairs below 4.5:1, videos without a captions or subtitles track (video-no-captions, warning) and a table of contents without headings in its level range (toc-no-headings, warning). Click an issue to jump to its block.
  • Field settings: content that breaks the field's preset, with automatic fixes.
  • Check links (POST /magic-editor-x/quality/links): internal links and mentions (entries you cannot read answer "Not checked", so nothing is revealed; "Not published" for drafts of Draft & Publish types), Media Library files of image, gallery, video and audio blocks (needs Media Library read) and, only when qualityChecks.externalLinks.enabled is true, external links through the SSRF-protected fetcher (public addresses only, pinned DNS, redirects re-checked, HEAD then a capped GET, rate limited per admin across processes, cached for 10 minutes). URLs are never logged.
  • Scheduled link check (opt-in): with qualityChecks.externalLinks.enabled and qualityChecks.externalLinks.schedule.enabled, a cron job (schedule.rule, server time, default 03:00 every day) scans every editor field of every api:: type (top level, components, dynamic zones; drafts and published versions; all locales) and checks up to maxUrlsPerRun external URLs, least recently checked first, at perMinute requests per minute and perHostConcurrency per host. In a cluster one process runs each check. The quality panel shows the last result for the field ("Scheduled check": broken links with their status for the draft and the published version; Enter on a link moves to its block), and Settings > Configuration shows the rule, the time zone, the next run and the last run, with Run now for admins with settings.update (POST /magic-editor-x/quality/link-schedule/run; it shows when a run is still going). Set schedule.tz (an IANA name such as 'Europe/Berlin') to run the rule in that zone instead of server time. URLs not checked within the budget keep their earlier result. Strapi's docs ask hosts to set cron: { enabled: true } in config/server; set it when you turn the schedule on. The plugin refuses to start when the schedule is on and externalLinks.enabled is off.
  • Private hosts: qualityChecks.externalLinks.allowPrivateOrigins lists exact origins (for example https://intranet.example.test) that both link checks may reach although they resolve to a private address. Redirects from them are not followed.
  • Publishing guard: with the field option publishGuard, publishing a document whose field has errors answers 400 details.code: 'QUALITY_GATE' with details.issues: [{ field, rule, blockId, locale? }] and details.errors for the form. Warnings never block. Since 2.4 the guard also runs when a document is created or updated directly as published (Content API ?status=published, strapi.documents().create/update({ status: 'published' })); such writes skipped it before. Releases show entries the guard refuses as not ready (see Strapi AI translations and Releases).

Audit trail

Settings > Magic Editor X > Audit trail lists who changed what and when: per editor field (created, updated, published, unpublished, discarded, deleted, with the number of added, removed, changed and moved blocks), versions (saved, restored, renamed), AI actions, comments and mentions, suggestions, templates and synced blocks, settings, link check runs and Strapi AI translations. Filter by event, person, content type, document and date.

  • No content: an event holds its type, the target (content type, document, locale, field), counts, up to 20 block ids and identifiers, the person and the time. Never text, e-mail addresses, IP addresses or tokens.
  • Who can read it: audit.read. The Settings page and listings across documents also need settings.read. The Activity tab in a field's version history shows that field's events and needs audit.read plus Content Manager read on the document (404 otherwise).
  • Retention: audit.retentionDays (180 by default; 0 keeps everything). One process prunes once an hour. Deleting an admin keeps their events and shows them as "Deleted user". audit.enabled: false stops recording.
  • Coverage: field changes are recorded from the Document Service, so the Content Manager, the Content API, imports and code are all covered; writes around it (db.query, raw SQL) are not. Content API writes are recorded without a person. With Strapi's Enterprise audit logs available, the events are also sent there.
  • The events are stored in the table magic_editor_x_audit, not in a content type.

Working together and reusing content (2.5)

Entry panel and who is editing

Every entry with a Magic Editor X field gets a Magic Editor X panel in the Content Manager (in the actions drawer on narrow screens):

  • Editing now lists the other admins who have the entry open, with names only. It works across several server processes and also without live collaboration (presence.enabled, default true). Only admins who can read the entry see the list.
  • Comments shows the open threads per field; Show opens that field's comments.
  • Quality shows issues and broken links per field of the saved draft; Check opens that field's quality panel.
  • Soft lock (presence.softLock: true, off by default): when someone else is editing, a dialog says so once per tab and you choose Continue editing. Nobody is ever locked out.

The admin home can show My open threads (threads you started or were mentioned in) and Broken links (entries you can read with broken links from the scheduled link check).

Unsaved changes

While a field has unsaved changes, Magic Editor X keeps them in your browser (IndexedDB, drafts.enabled, default true). After a reload, a crash, a closed tab or an ended session the field shows "Unsaved changes from … were found." Choose Restore (one Undo reverts it) or Discard. If the saved content changed in the meantime, the notice says so and never restores automatically. Local drafts are removed when you save, discard, after drafts.ttlHours (72) and when you log out. While a field is live in a collaboration room the room keeps your edits, so nothing is stored locally; a draft is kept only during connection gaps. Strapi does not tell the browser when a session will end, so there is no countdown; the local draft covers that case.

Insert from another entry and copy blocks

More tools > Insert from another entry copies blocks from any entry, field or language you can read: choose the entry (type, language and field are preselected and hidden when there is only one choice), tick the blocks in the preview and choose Insert N blocks. The source is the entry as last saved. Blocks the field does not allow are listed with the reason. Every inserted block gets a new id, so comments and suggestions stay with the source; synced blocks stay synced; images keep their Media Library file.

Copy blocks between fields, entries and browser tabs with Ctrl/Cmd+C (after selecting blocks) or Copy block in the block menu, and paste with Ctrl/Cmd+V: custom blocks, blocks registered in code and alignment are kept. Turn the dialog off with reuse.enabled: false.

Long entries

Editors start when a field comes within lazyInit.marginPx (800 px) of the screen or gets focus; until then the field shows its saved content. With 20 fields plus a dynamic zone, 4 editors and live connections start instead of 20 and the page has fewer than 40 % of the DOM nodes. Turn it off with lazyInit.enabled: false.

Colours, superscript, subscript and annotations

Define a palette in the plugin configuration and turn the tools on per field in the Content-Type Builder (Advanced settings > Extra formatting). All of them are off by default.

// config/plugins.js
'magic-editor-x': {
  config: {
    palette: {
      colors: [{ name: 'accent', label: 'Accent', light: '#b3261e', dark: '#ffb4ab' }],
      highlights: [{ name: 'note', label: 'Note', light: '#fff3b0', dark: '#5c4a00' }],
    },
  },
},
  • Text colour and highlight (inlineColors): one Colour button (Ctrl/Cmd+Shift+7) with your tokens. Content stores the token name (<span data-mex-color="accent">, <mark data-mex-highlight="note">), never a colour or a style; the renderers add the classes mex-color-<name> and mex-highlight-<name>, which your site styles. Settings > Magic Editor X > Configuration shows the CSS to copy and lists combinations below 4.5:1 contrast; the quality rule color-contrast flags them in fields.
  • Superscript and subscript (inlineScript): Ctrl/Cmd+. and Ctrl/Cmd+Shift+. (footnote markers are not affected).
  • Inline annotations (inlineAnnotations, a comma list): the built-in abbreviation (Ctrl/Cmd+Shift+9) renders <abbr title="…">. Register your own in code with registerInlineAnnotation (magic-editor-x/blocks, see Custom blocks in code (SDK)), for example a glossary term whose definition is looked up when content is read.

Private upload providers and dropped files

With a private upload provider (isPrivate(), for example a private S3 bucket), Magic Editor X stores each Media Library file with its id and its unsigned URL and signs it fresh on every Content API, GraphQL and ?mex= read and in the editor. Content saved before 2.5 is updated once at startup; run npx magic-editor-x media-file-ids to see what would change and --apply to run it again. Public providers are not affected.

On Strapi 5.61 and later, drag images, videos or audio files onto a field: they are uploaded to the Media Library and inserted as blocks. Older Strapi versions keep the previous behaviour.

Tools for AI clients (MCP)

With mcp.enabled: true and Strapi's own MCP server on (server.mcp.enabled), Magic Editor X adds the tools mex_from_markdown, mex_from_html, mex_validate and mex_render, one JSON Schema resource per preset and the prompt mex_content_guide. They only convert and check content; they read and write no entries. The admin token of the AI client needs the action plugin::magic-editor-x.mcp.use.

Component blocks, columns and Live Preview (2.6)

Component blocks

  1. In the Content-Type Builder, open a Magic Editor X field, go to Advanced settings and pick the components editors may insert under Component blocks. Components with fields that cannot be used as blocks are listed with the reason.
  2. In the field, open the + menu (or type /) and choose the component by its name. A form with the component's fields appears in the block.
  3. Fill it in. Required fields, lengths, ranges, patterns and choices are checked while you type and again when the entry is saved, by every writer (Content Manager, Content API, code).

Supported field types: text (short and long), rich text as plain text, e-mail, enumeration, date, date and time, time, integer, big integer, float, decimal and boolean. Components with media, relations, nested components, JSON, password, uid or private fields cannot be used as blocks. A component removed from the app keeps its stored values; the block shows a notice and the API leaves it out.

Stored as { "type": "component", "data": { "uid": "blocks.cta", "values": { ... }, "_mex": 1 } }. Renderers output nothing for component blocks unless you pass componentBlocks (HTML, renderTree, React, Vue) or an override, so existing front ends do not change:

renderHtml(value, {
  componentBlocks: {
    'blocks.cta': (block, { h, url, textNode }) =>
      h('a', { class: 'cta', href: url(block.data.values.url) }, [textNode(block.data.values.title)]),
  },
});

Columns

Open the + menu, choose 2 columns or 3 columns (or type /col) and type. Each column holds paragraphs, headings and list items with the field's inline formatting; Enter starts a new item, Backspace in an empty item removes it, and the arrow keys move between items and columns. The toolbar above the block sets the text style and the width (equal, wide left, wide right); the block menu sets the number of columns (2 to 4), the space between them and the vertical alignment.

Output: div.mex-columns[data-mex-columns] with one div.mex-column per column and classes for the layout (no inline styles), so your site's CSS decides the widths and where the columns stack. Plain text and Markdown list the columns one after the other in reading order. Columns work with live editing (also while someone changes the number of columns), undo, Copy block, templates, insert from another entry, comments, AI, Strapi AI translations, find and replace, quality checks and version history. A table of contents does not list headings inside columns.

Live Preview

Strapi's preview shows your front end next to the entry. With the renderer option blockIds (or ?mex=html&mexBlockIds=true on the Content API) each rendered block carries data-mex-block-id and data-mex-field-path. A front end can then link a click on a block to the edit view (editViewUrl from magic-editor-x/render), which opens the entry with the caret in that block, also for fields that start lazily. Typing directly in the preview page is not possible with Strapi's public APIs (Strapi 5.62.0, checked 2026-11-17); see the Live Preview guide and the research record.

Signed out while editing

Strapi does not tell the browser when an admin session ends, so Magic Editor X notices it from the answers to its own and Strapi's requests (a refused token refresh, a 401 on save, a closed live connection). Then one calm banner says "You were signed out. Your changes are kept on this device. Sign in again to save." Your text stays in the editor and is kept on this device at once and with every change; live editing pauses instead of retrying. Sign in again opens the login page in a new tab, so the entry and everything you typed stay open; after signing in, live editing resumes and sends what you typed, and you save as usual. If you click Save anyway and Strapi sends you to the login page, open the entry again: your text comes back with one click. A live connection also ends on the server within 5 seconds of the session end, so nothing typed after the end reaches others before you sign in again.

Data format

The field stores an Editor.js document as JSON:

{
  "time": 1762866000000,
  "version": "2.31.7",
  "blocks": [
    { "id": "kq1x9w0abc", "type": "header", "data": { "text": "Release notes", "level": 2 } },
    {
      "id": "kq1x9w0abd",
      "type": "paragraph",
      "data": { "text": "Read the <a href=\"https://example.test\">guide</a>." },
      "tunes": { "alignmentTune": { "alignment": "left" } }
    }
  ]
}

A value inside a repeatable component or a dynamic zone also carries a top-level fieldKey (2.4): 16 to 32 characters A-Z a-z 0-9 _ -, set by the plugin when the value is saved. It keeps version history, comments and live editing with that entry when entries are moved, added or removed, and survives publish, discard draft, "Fill in from another locale" and duplication. Keep it when you write such values through the API; values without it get a new key (an entry sent with its component id keeps the stored key). Renderers ignore it. Top-level fields and fields in single components never have one.

Data of each block type as stored after sanitising (shared/sanitize-policy.mjs):

Block data
paragraph { text } (inline HTML)
header { text, level: 1-6 }
list { style: 'ordered' | 'unordered' | 'checklist', meta?: { start?, counterType? }, items: [{ content, meta?, items: [...] }] }
checklist { items: [{ text, checked }] }
quote { text, caption, alignment: 'left' | 'center' }
warning { title, message }
alert { type: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'light' | 'dark', align: 'left' | 'center' | 'right', message }
toggle { text, status: 'open' | 'closed', fk?, items } (the next items blocks are its content)
code { code } (plain text)
codeFlask { code, language, showlinenumbers?, filename? } (filename 2.4: plain text, max 200 characters, stored only when set)
raw { html } (see rawHtml)
table { withHeadings, stretched, content: string[][], headerColumn?, align?, merges?, caption? } (2.4 keys, stored only when set: headerColumn: true; align: per column 'left' | 'center' | 'right' | null; merges: [{ row, col, rowspan, colspan }] (max 1000, covered cells ''); caption inline HTML, max 4000. At most 500 rows and 100 columns)
math (2.4) { tex, display } (tex plain-text TeX, max 10000; display: false = text style)
image { file: { url, mime?, alt?, width?, height?, size?, formats?, id?, documentId? }, caption, withBorder, withBackground, stretched, decorative?, focalPoint? } (id/documentId reference the Media Library file, formats its responsive sizes; decorative: true = intentionally empty alternative text; focalPoint: { x, y } from 0 to 1, two decimals)
gallery (2.3) { images: [{ file, caption, decorative?, focalPoint? }] (at most 50), layout: 'grid' | 'carousel', columns: 1-6 (default 3), caption } (file like the image block; entries without a URL or with a non-image MIME type are dropped)
video (2.3) { file: { url, id?, documentId?, mime?, name?, hash?, ext?, width?, height?, size? }, poster?, title, caption, loop, muted, tracks } (file must be video/*; poster an image file; no autoplay)
audio (2.3) { file, title, caption, loop, tracks } (file must be audio/*)
video/audio tracks [{ file, kind: 'captions' | 'subtitles' | 'descriptions' | 'chapters', srclang, label, default? }] (at most 8, WebVTT files only, at most one default)
toc (2.3) { title, minLevel: 1-6 (default 2), maxLevel: 1-6 (default 4), style: 'ordered' | 'unordered' } (only the settings are stored; the entries are built from the headings when rendering)
synced (2.3) { ref } (the documentId of a synced source, or '' when invalid; nothing else is stored)
simpleImage { url, caption, withBorder, withBackground, stretched, alt?, decorative? }
linkTool { link, meta: { title, description, site_name?, image?: { url } } }
attaches { file: { url, name?, extension?, size?, title? }, title }
embed { service, source, embed, width?, height?, caption } (embed is always https)
personality { name, description, link, photo }
button { text, link, style, openInNewTab }
delimiter {}
custom simple block { content, <field values>, blockType: 'simple', blockName }
custom embedded-entry block { entry: { id, documentId, title, <display fields> }, contentType, displayMode }
block defined in code (SDK) the keys of its schema, in declaration order (see Custom blocks in code (SDK))

Blocks toc, gallery, video, audio, synced (2.3) and math (2.4) also store _mex: 1, the built-in marker. Before 2.3 a custom block could have one of these names; its stored data has neither the marker nor exactly the built-in keys, so it stays custom block data everywhere (sanitising, editor tool, renderers, API output) and is never rewritten. Write the marker (or exactly the keys listed above) when you create these blocks through the API. New custom blocks cannot use these names or mention. A block registered in code with the block SDK may still be named math, so 2.3 hosts that registered one keep starting.

Inline HTML may contain b, strong, i, em, u, s, mark, code, a (href, target, rel, title, and for internal links data-mex-uid, data-mex-document-id, data-mex-locale, plus data-mex-mention="true" for mentions), br, span (class cdx-tooltip with data-tooltip, or data-mex-math="true" around inline TeX, 2.4), sub and sup (data-mex-footnote="<id>" and data-mex-note="<note HTML>" for a footnote, 2.4; the note follows the same inline rules, without footnotes). Links allow http, https, mailto, tel and relative URLs. Escape plain-text fields (code, personality, button.text, link card text) when you render them.

Internal links

The link tool (CMD+K) has a Link to an entry button: choose a content type, search by title (arrow keys move through the results, Enter picks, Escape closes) and the selected text becomes a link to that entry. The picker lists only the content types and entries you can read in the Content Manager, with its conditions and field permissions. The link is stored as plain HTML:

<a
  href="/articles/x7k2m9q4p1v8"
  data-mex-uid="api::article.article"
  data-mex-document-id="x7k2m9q4p1v8"
  data-mex-locale="en"
  >our guide</a
>
  • href is always a normal URL, so every frontend can render the link as it is. It is built on the server from links.urlPattern when the link is inserted: {documentId}, {locale} (empty for types without i18n; empty path segments are removed), {slug} (the first uid attribute of the type, or the documentId when there is none), {collection} (plural API name) and {singular} (singular API name). Values are URL-encoded. The pattern must be a site-relative path or an http(s) URL with a fixed host. Without a pattern the link is /{collection}/{documentId}.
  • data-mex-uid, data-mex-document-id and data-mex-locale identify the entry, so a frontend can resolve the current URL itself (for example when a slug changed after the link was inserted). They are kept only when they are valid and only on <a>; a link whose address you edit by hand becomes a normal link.
  • Mentions are internal links with data-mex-mention="true"; their text is the entry title at the time of insertion. Everything above applies to them (presets, link check, resolveHrefs, API output); renderers add class="mex-mention", and the links resolver receives mention: true.
  • Links follow slug changes because the entry reference is stored, not only the URL: render with renderHtml(value, { links: ({ uid, documentId, locale, href }) => urlFor(uid, documentId, locale) }) (see Rendering content), or in server code await strapi.plugin('magic-editor-x').service('links').resolveHrefs(value, { status: 'published' }), which re-renders every internal href from links.urlPattern and the entry's current slug (one query per type and locale; links to deleted entries keep their stored href; it does not check admin permissions, so use it for content the caller may already see).

Tunes are stored per block in tunes: alignmentTune: { alignment }, textVariant: '' | 'call-out' | 'citation' | 'details', indentTune: { indentLevel }.

The Content API returns the object as stored. Entries saved with 1.x may still contain a JSON string until they are saved again; with api.autoParseJSON (default) the plugin parses such strings in Content API GET responses. Only Magic Editor X fields are parsed (also inside components, dynamic zones and populated relations); other fields are returned as stored.

TypeScript types per field

magic-editor-x/types describes every block a field could hold. For a frontend that should know exactly what one field can contain, generate types from your project:

npx magic-editor-x types --out src/types/magic-editor-x.ts                           # every field
npx magic-editor-x types --uid api::article.article --out src/types/article-body.ts  # one content type and its components

Run it from the Strapi project root, like migrate. It loads the project the same way (compileStrapi, createStrapi().load(), no HTTP server) and reads:

  • every content type and component with a Magic Editor X field, and each field's preset options (preset, allowedBlocks, headingLevels, allowedComponents), resolved with the same code the server uses on save;
  • the custom blocks from Settings > Magic Editor X > Custom blocks, enabled and disabled (stored content can hold both);
  • the blocks registered in code with the block SDK.

The generated module has, per field, a discriminated union of the block types the preset allows (heading levels narrowed, component blocks only for the listed components), typed data for Settings custom blocks (from their field definitions) and SDK blocks (from their schema), and a map from uid and field name to the value type:

import type { ArticleBodyBlock, MagicEditorXFieldValues } from './types/magic-editor-x';

type Body = MagicEditorXFieldValues['api::article.article']['body']; // { time, blocks: ArticleBodyBlock[], version } | null

const text = (block: ArticleBodyBlock) => {
  switch (block.type) {
    case 'paragraph':
      return block.data.text;
    case 'header':
      return `H${block.data.level}`; // level is 2 | 3 with the "basic" preset
    default:
      return '';
  }
};

Options: --out <file> (default: print to stdout; Strapi's log lines go to stderr), --uid <uid> (repeatable; a content type or component and every component it uses), --import-from <module> (where the built-in block types come from, default magic-editor-x/types). Run it again after you change a content type, a field preset or a custom block; the output is deterministic, so a CI job can compare it with the committed file.

What the types promise and what they do not:

  • Settings custom block fields are optional (?), because blocks saved before a field was added do not have it. An empty number field is stored as ''. Text fields are inline HTML (InlineHtml).
  • A name in allowedBlocks without a definition (for example a deleted custom block) is typed with Record<string, unknown> data and named in a comment.
  • The block limits (maxBlocks, maxCharacters), link targets and required alternative texts are listed in each field's comment; TypeScript cannot check them. The server still enforces every rule on save.

The command only reads. It writes nothing but the output file and makes no network requests: while it runs, fetch() refuses every request (Strapi's own update check and telemetry use it), telemetry is off and scheduled jobs are stopped. The database connection from the project's configuration is used as usual. Bootstrap code of other plugins in your project still runs, as with migrate. The same generator is available in code: await strapi.plugin('magic-editor-x').service('types').generate({ uids }) returns { code, fields, customBlocks, codeBlocks }.

Rendering content

npm i magic-editor-x also gives you a framework-free renderer (ESM and CommonJS, no dependencies, no Node built-ins, so it runs in Node, browsers and edge runtimes), a JSON Schema and TypeScript types:

import { renderHtml, renderText, renderMarkdown } from 'magic-editor-x/render';

const html = renderHtml(entry.body, {
  links: ({ uid, documentId, locale, href }) => `/${locale}/articles/${slugs.get(documentId)}`, // internal links follow slug changes
  media: (file) => file, // refresh Media Library files by file.id / file.documentId if you like
  overrides: { myHero: (block, h) => `<section class="hero">${h.escape(block.data.title)}</section>` },
});
const text = renderText(entry.body); // search index, meta description
const markdown = renderMarkdown(entry.body); // feeds, LLM context, export
  • Safe by default: stored inline HTML is re-parsed and only the editor's own tags and attributes survive (entities are decoded before URL checks, javascript:/data: links are dropped, target="_blank" gets rel="noopener noreferrer"), so the output is safe even for content that did not pass the server sanitiser. Raw HTML blocks are left out unless you pass rawHtml: 'allow' together with your own sanitizeRaw function. Embeds become iframes (sandbox, loading="lazy", referrerpolicy) only for embedHosts (default: YouTube, youtube-nocookie, Vimeo player, CodePen, Twitch, Figma, Miro); other embeds become links.
  • Output: HTML elements with stable mex- classes (tunes as mex-align-*, mex-variant-*, mex-indent-N), images with srcset from the Media Library formats, width, height and lazy loading (imageSizes, default 100vw), decorative images with alt="", toggles as <details>. Custom blocks render as <div class="mex-block mex-<name>" data-mex-block> with escaped values unless you pass an override. Markdown is CommonMark plus GFM tables and task lists: adjacent or nested marks of one kind are written as one run, a line break at the end of a block, item or cell is dropped, and two lists in a row get different markers (-/*, 1./1)) so they stay two lists. Emphasis that ends in punctuation right before a letter (<b>"a"</b>b) cannot be expressed in CommonMark and stays literal there. Plain text uses blank lines between blocks.
  • Deterministic: the same value always gives the same string.
  • Schema: magic-editor-x/schema is a JSON Schema (draft 2020-12) of the stored value with one data schema per block type; validate content in CI. Types: import type { MagicEditorXData, MagicEditorXBlock } from 'magic-editor-x/types', or types per field with npx magic-editor-x types.

Options added in 2.3

All are off or neutral by default, so renderHtml output for existing content is the same as in 2.2 unless the value has a table of contents.

Option Values Effect
code { lineNumbers?: boolean | 'block', copyButton?: boolean | { label, copiedLabel, failedLabel } } Line numbers (<span class="mex-code-line"> per line, numbers from CSS counters; 'block' follows the block's own setting) and a copy button with a polite status region. Call enhanceCodeBlocks() in the browser to wire the buttons of server-rendered HTML.
focalPoint 'data' (default) | 'style' data-mex-focal-x/data-mex-focal-y on <img> (no inline style, works under a strict CSP), or also style="object-position:X% Y%".
headingIds true | false id="mex-h-<blockId>" on headings. Default: only when the value has a toc block. The anchor is the block id, so it survives text edits, reordering and translated locales.
toc { label? } aria-label of a table of contents without a title (default "Table of contents").
blocks array of defineBlock definitions Blocks defined in code (see Custom blocks in code (SDK)).
synced { [ref]: document | blocks }, a Map, or (ref) => document | blocks | null Sources of synced blocks. Without it, or for an unknown ref, a synced block renders nothing. The copies are cleaned and rendered like any block, and a table of contents lists their headings.

New block output: gallery as <figure class="mex-gallery mex-gallery-<layout> mex-gallery-cols-<n>"> with a list of figures, video and audio as <figure class="mex-video">/<figure class="mex-audio"> with native controls and <track> elements (never autoplay), the table of contents as <nav class="mex-toc"> with nested ol/ul links to the heading ids, mentions as <a class="mex-mention">. Markdown output of a table of contents links to GitHub-style slugs of the heading text, because Markdown pipelines assign heading ids themselves.

Options added in 2.4

Output for content without math, footnotes, code file names or 2.4 table keys is unchanged.

Option Values Effect
math (tex, { display }) => MathML string | nodes Renders formulas. The result goes through a MathML allow-list (no links, styles, ids, event handlers or HTML). Without it, or when it fails, the TeX is written escaped between \( \) or \[ \], so client-side KaTeX or Temml can pick it up.
footnotes { label?, backLabel?, prefix? } Footnote list heading (default "Footnotes"), back-link label (default "Back to reference {n}") and id prefix (default mex-). Markers become numbered links; the list follows the content as <section class="mex-footnotes">.

magic-editor-x/math exports renderMath(tex, { display }) (MathML string or null, Temml with trust: false), checkMath(tex, { display }) and MATH_SETTINGS; pass it as the math option: renderHtml(value, { math: renderMath }). ?mex=html|text|markdown and the GraphQL …Rendered fields render MathML this way and give each value its own footnote id prefix.

New output: tables with <caption>, <th scope="col|row">, colspan/rowspan and mex-align-<value> classes (Markdown: a GFM alignment row; merged cells cannot be expressed there, so the text stays in the first cell); code with a file name as <figure class="mex-code-figure"><figcaption class="mex-code-filename">; math as <span class="mex-math"> or <div class="mex-math mex-math-display">; in Markdown, math as $…$ / $$…$$ and footnotes as GFM [^n]. Renderers that do not know the 2.4 table keys still show a full grid.

renderTree(value, options) returns the same output as plain nodes ({ type: 'element', tag, attrs, children }, { type: 'text', value }) for your own serialiser; serializeNodes(nodes) turns them into the renderHtml string.

import { renderHtml } from 'magic-editor-x/render';

const html = renderHtml(entry.body, {
  synced: (ref) => sources.get(ref) ?? null, // sources you loaded, for example from ?mex=json
  code: { lineNumbers: 'block', copyButton: true },
  focalPoint: 'style',
});

React and Vue components

magic-editor-x/react and magic-editor-x/vue export MagicEditorXContent, built on the same render tree as renderHtml: text stays text, URLs are validated, and dangerouslySetInnerHTML/innerHTML is used only for raw HTML blocks you opt in to with rawHtml: 'allow' and sanitizeRaw.

import { MagicEditorXContent } from 'magic-editor-x/react';

<MagicEditorXContent
  value={article.content}
  options={{ code: { lineNumbers: 'block', copyButton: true } }}
  components={{ paragraph: ({ children }) => <div className="lead">{children}</div> }}
/>;
  • Props: value, options (every option above) and components (per block type, receives { block, helpers, children }; children is the default output). Vue also takes scoped slots block-<type>, which win over components.
  • React 18 and 19, server rendering and React Server Components (the copy button needs a client component or enhanceCodeBlocks()); Vue 3.5 or later, also with Nuxt server rendering.
  • Guides: React, Vue and Nuxt, Astro (renderHtml with set:html, or the components as server-rendered islands, plus the CSS for line numbers and copy buttons).

Content API and GraphQL output

Without extra parameters the Content API returns the stored value, as in 2.2. Add ?mex= to a GET request to get the field rendered or resolved instead:

mex Each Magic Editor X field becomes
html The rendered HTML string ('' when empty)
text Plain text
markdown Markdown
json The stored document, cleaned with the field's sanitiser again, with resolved references (internal links, media, synced blocks)
GET /api/articles/k9d2w4xq8m1n0p3r5t7v9b1c?mex=text
Authorization: Bearer <API token>
{
  "data": {
    "documentId": "k9d2w4xq8m1n0p3r5t7v9b1c",
    "title": "Release notes",
    "body": "Release notes\n\nRead our guide.\n\nShared footer"
  },
  "meta": {}
}
  • Works on GET requests of Content API routes of api:: content types (find, findOne and custom GET actions of the same controller), for fields at the top level, in components, in dynamic zones and in populated relations, in the flat and the Strapi-Response-Format: v4 response. Admin and plugin routes and error responses are never changed, also when mex has an invalid value (/api/upload/files?mex=x answers as without it). On routes of api:: content types any other value answers 400 (details.param: 'mex'). mex is registered with Strapi's contentAPI.addQueryParams, so it also passes with api.rest.strictParams: true.
  • References are resolved with the caller's own permissions (API token or users-permissions role): a target entry is read only when the caller has find on its type, Media Library files only with the upload plugin's find, and every row goes through Strapi's output sanitising. Published versions are used unless the request asks for status=draft.
  • Internal links and mentions get the href from links.urlPattern with the current slug; a resolved mention shows the entry's current title. A link the caller may not see, or that points to a missing or draft-only entry, is removed and only its text stays. Embedded entries (custom blocks) get the live display fields, or entry: null. Media Library files get their current URL and formats. Synced blocks are expanded with the containing field's sanitiser and preset; json output marks the copied blocks with syncedFrom.
  • Raw HTML blocks are left out of html, text and markdown. Heading ids are written in html when the value has a table of contents.
  • Bounds: 500 distinct references and 5 seconds per response; at most 100 distinct synced sources per response. References over the limit stay unresolved.

GraphQL (when @strapi/plugin-graphql is installed): for every Magic Editor X attribute body of an api:: content type or component in the schema, the plugin adds bodyRendered(format: MagicEditorXFormat = HTML): String (HTML, TEXT, MARKDOWN) and bodyResolved: JSON, with the same resolution and permissions. Fields inside components and dynamic zones (also nested ones) resolve with the locale and publication status of the entry that holds them, like ?mex= (internal links, mentions and footnote ids of a locale: "de", status: DRAFT query point to the German drafts); a populated relation uses its own entry. Fields that are private, disabled through shadowCRUD, or that would clash with an existing attribute name are skipped.

query {
  articles {
    title
    bodyRendered(format: HTML)
  }
}

In server code, strapi.plugin('magic-editor-x').service('references').transform(items, { format, auth, status }) gives the same output.

Custom blocks in code (SDK)

When a block needs real code (its own editor UI, strict data rules or frontend output you control), define it once with defineBlock from magic-editor-x/blocks and use the definition on the server, in the admin and in your frontend:

import { defineBlock } from 'magic-editor-x/blocks';

export const calloutCard = defineBlock({
  name: 'calloutCard',
  title: 'Callout card',
  schema: {
    title: { type: 'text', max: 120 },
    body: { type: 'inline', max: 2000 },
    link: { type: 'url' },
    tone: { type: 'enum', values: ['info', 'success', 'warning'] },
  },
  presets: ['article'],
});
  • Server: call strapi.plugin('magic-editor-x').service('blocks').register(calloutCard) in your app's register(). Every save cleans the block with its schema (unknown keys dropped, values bounded, URLs and inline HTML through the same policies as built-in blocks); presets, live collaboration, ?mex= and GraphQL use it without further wiring. A Settings custom block with the same name stops Strapi from starting (NAME_TAKEN).
  • Admin: in src/admin/app.js, call app.getPlugin('magic-editor-x').apis.registerBlock({ definition, tool, title?, icon?, i18n?, inlineToolbar?, shortcut? }); apis.createReactTool(Component) turns a React component into an Editor.js tool. Settings > Custom blocks lists code blocks read-only under "Defined in code".
  • Frontend: pass blocks: [calloutCard] to renderHtml, renderText, renderMarkdown or the React/Vue components; give the definition a render, text or markdown function for your own output, or get a neutral default.
  • Field types: text, inline, url, enum, number, boolean, array, object. blockJsonSchema(definition) returns the JSON Schema of the stored shape.

The full guide with the admin tool, field types and security notes is docs/guides/custom-blocks-sdk.md.

Core Blocks bridge

Strapi's own Blocks field (the core rich text field, not the Magic Editor X field) lets developers add custom blocks to its editor with the Content Manager API addRichTextBlocks (Strapi 5.46 and later). Strapi's server does not know those blocks yet: it rejects every node type it does not know with Block node is of invalid type, so an entry with a custom block cannot be saved or published from the admin, the REST API or the Document Service. The fix in Strapi is proposed in strapi/strapi discussion 25546. Until it ships, the Core Blocks bridge lets the block types you register pass Strapi's check, each against its own rules.

Settings: the Core Blocks bridge switch, its status and the registered block types

Turn it on (admins): Settings > Magic Editor X > Configuration > "Custom blocks in Strapi Blocks fields" > switch Save registered custom blocks > Save. It takes effect at once, without a restart (other server processes follow within 30 seconds). It is off by default; coreBlocks.enabled: true in config/plugins.js sets the default, and the switch wins once it was saved. The section shows the status, the block types the server knows and any block type the editor offers without server rules.

Register a block type (developers), once per type, with the same type on both sides:

  1. Server, in src/index.js register() (or a plugin's register/bootstrap):

    module.exports = {
      register({ strapi }) {
        strapi
          .plugin('magic-editor-x')
          .service('core-blocks')
          .register({
            type: 'callout', // the node `type` the editor writes
            validator: ({ yup, inlineNodeValidator }) =>
              yup
                .object({
                  type: yup.string().equals(['callout']).required(),
                  tone: yup.string().oneOf(['info', 'warning']).required(),
                  children: yup.array().of(inlineNodeValidator).min(1).required(),
                })
                .noUnknown(), // unknown keys are rejected (nodes are validated with strict: true)
          });
      },
    };
  2. Admin, in src/admin/app.js register(app); addCoreBlocks passes the blocks to addRichTextBlocks and sets matchNode to node.type === '<key>' when you leave it out:

    import { Information } from '@strapi/icons';
    import { Transforms } from 'slate';
    
    export default {
      register(app) {
        app.getPlugin('magic-editor-x').apis.addCoreBlocks({
          callout: {
            renderElement: (props) => <aside {...props.attributes}>{props.children}</aside>,
            icon: Information,
            label: { id: 'app.blocks.callout', defaultMessage: 'Callout' },
            isInBlocksSelector: true,
            handleConvert(editor) {
              Transforms.setNodes(editor, { type: 'callout', tone: 'info' });
            },
          },
        });
      },
    };
  3. An admin turns the bridge on in Settings.

The core Blocks editor with a paragraph and a custom callout block, saved and published

The validator is a Yup schema, the library Strapi validates Blocks with (yup 0.32 from @strapi/utils), or a function (helpers) => schema that runs once at registration. Helpers: yup, textNodeValidator, linkNodeValidator, inlineNodeValidator (text or link, as in a paragraph) and checkValidLink, the same rules Strapi uses for built-in blocks. Nodes are validated as sent (strict: true, nothing is cast) on a copy, so a schema can never change what is stored. Validate every key your renderer reads and end object schemas with .noUnknown(): a plain yup.object() lets unknown keys through, and they are stored. Check nested children with the helpers (inlineNodeValidator for text and links) instead of yup.mixed(). register() throws CoreBlockDefinitionError with a code: INVALID_DEFINITION, INVALID_TYPE (lowercase letters and digits joined by single hyphens, up to 64 characters), BUILTIN_TYPE (paragraph, heading, quote, list, list-item, image, code, text, link), TYPE_TAKEN, INVALID_VALIDATOR, TOO_MANY_TYPES (100). addCoreBlocks throws CoreBlockEditorError for invalid definitions and returns false with one console error on Strapi before 5.46.

What the bridge does and does not change:

Content With the bridge on
Built-in blocks (paragraph, heading, list, quote, code, image, links) Checked by Strapi exactly as before; stored JSON is identical to the bridge being off
A registered type, valid Saved and published; the stored node is the node the editor sent
A registered type, invalid 400 ValidationError with its own message and path, for example ["body", "1", "tone"]
An unregistered type Rejected by Strapi with its own error, byte for byte the same as without the bridge
Over the limits, prototype keys, not plain JSON 400 before any registered validator runs (limits below)
Bridge off, or nothing registered No change at all: Strapi's validator is not wrapped (off) or every call passes straight to it
  • Where: top-level nodes of every blocks attribute of a content type, also inside components, repeatable components and dynamic zones. Inline nodes stay limited to text and link, as in Strapi.
  • Limits per custom node: 32 levels of nesting, 10,000 values, 256 KB of text; 1000 custom nodes per write; no __proto__, constructor or prototype keys; only objects, arrays, strings, finite numbers, booleans and null.
  • PostgreSQL stores Blocks as jsonb, which orders object keys and drops whitespace for every node, built-in or custom; the content is the same, only the key order of the stored text differs (as without the bridge).
  • How it works: the bridge wraps Strapi's entity validator (strapi.entityValidator.validateEntityCreation/validateEntityUpdate, used by the Document Service for every write and publish). Registered nodes are checked with their schema and replaced by placeholder paragraphs for Strapi's own validation; afterwards the original nodes are put back. If Strapi's result no longer has the placeholder where the node was, the write is rejected so nothing is lost.
  • Version gate: each time the bridge is switched on (at start when the switch is on, when it is saved as on in Settings, and when another process's change turns it on) a canary checks that Strapi's validator still accepts a paragraph and rejects an unregistered probe type with "Block node is of invalid type". If the hook point is missing or changed, the bridge logs one error, stays out and custom blocks are rejected as before; saving the switch as on again retries. It never crashes Strapi or weakens validation. Every registered type is also probed against Strapi's own validator before the bridge validates it: a type Strapi already knows (for example a block a later Strapi adds) is left to Strapi, logged once and listed in Settings. CI runs the bridge tests on the peer floor (5.38.0) and the newest Strapi 5.x for every pull request.
  • When Strapi supports it: if the running Strapi validates custom blocks itself (strapi.customBlocks, as proposed in the RFC), the bridge turns itself off, logs this once and hands the registered types to Strapi's registry. Settings then shows "Handled by Strapi".
  • Permissions: unchanged. The switch needs "Update settings" like the other settings; the bridge adds no route and no action.
  • Compatibility: the server part works from Strapi 5.38; the editor helper needs addRichTextBlocks, which Strapi added in 5.46.0.
  • Converting to Magic Editor X: magic-editor-x migrate (format blocks) and strapiBlocksToEditor convert Strapi's built-in node types only. Custom node types, including the types you register for the bridge (for example callout), have no Editor.js equivalent: they are left out and listed in the report as unsupported-node with their type (never guessed or turned into paragraphs). Convert them yourself, for example into a custom block, after the migration. Code blocks keep their exact text, including a trailing line break.

Strapi AI translations and Releases

Both run only when your Strapi plan includes the feature; on a Community Edition host the plugin's hooks stay inactive.

AI translations. Strapi 5.61's AI translation (i18n) sends every localised attribute of a new or changed default-locale entry to its provider and writes the answer into the other locales. For a Magic Editor X field that was the whole stored JSON, and the answer replaced it: in tests a provider emptied the field or changed formulas and code, and block ids, URLs and footnotes were sent. Since 2.4, inside such a job only the inline texts of each field go to the provider (links as placeholders), and the other locale's value is rebuilt from the source structure, taking only the translated text. Formulas, code, tables, files, URLs, internal links and footnote ids stay as in the source; positional fields keep their own fieldKey. When a text comes back with links or formulas that do not match, the source text is kept. When the source value cannot be found, the write fails with 400 AI_TRANSLATION_UNSAFE and Strapi marks that locale as failed. The audit trail records ai.localize per field. Other writes (Content Manager, Content API, "Fill in from another locale") are never touched.

Releases. Strapi's Releases check entries with its own validator, which accepts any JSON. An entry the publishing guard would refuse showed as ready, and publishing the release then failed as a whole. Since 2.4 such entries show as "Not ready to publish" until the errors in guarded fields are fixed; warnings never block and drafts are never checked. The same check now covers writes that publish directly with status: 'published' (Content API ?status=published), which skipped the guard before. Preset violations are not part of the readiness check because every save already refuses them.

Admin API and permissions

Permissions

Action Label in Roles Gates
plugin::magic-editor-x.access Use the editor (uploads, link previews, custom blocks, version history) Editor configuration, link previews, uploads (with the Media Library permission), content type list, internal-link search, custom block list, templates offered in a field, version history, link check, collaboration, comment, grammar and AI routes
plugin::magic-editor-x.collaborate Edit together in real time Joining live rooms
plugin::magic-editor-x.ai.use Use the AI assistant AI requests
plugin::magic-editor-x.custom-blocks.manage Manage custom blocks Settings > Custom blocks and its routes
plugin::magic-editor-x.settings.read Read settings Settings > Configuration (read)
plugin::magic-editor-x.settings.update Update settings Saving settings, testing the AI connection
plugin::magic-editor-x.comments.read Read block comments Comment threads in the editor (with Content Manager read on the document)
plugin::magic-editor-x.comments.write Write block comments New threads, replies, resolve and reopen, editing and deleting your own comments (no update right needed)
plugin::magic-editor-x.comments.moderate Moderate block comments Deleting other people's comments
plugin::magic-editor-x.grammar.use Use the grammar check (LanguageTool) The "Check grammar" toolbar button and POST /grammar/check
plugin::magic-editor-x.templates.manage Manage templates and block patterns Settings > Magic Editor X > Templates (templates, patterns and synced blocks, usage counts, synced block versions), "Save content as template" and "Save as pattern" in the editor, "Edit source" on synced blocks
plugin::magic-editor-x.audit.read Read the audit trail (who changed what and when) The Activity tab of a field (with Content Manager read), Settings > Audit trail (with settings.read)
plugin::magic-editor-x.suggestions.create Suggest block changes (read access to the entry is enough; withdraw own) Suggest mode, sending suggestions, withdrawing your own
plugin::magic-editor-x.suggestions.review Review block suggestions (accept or reject; needs update access to the entry) Accepting and rejecting suggestions (with Content Manager update)
plugin::magic-editor-x.mcp.use Use the Magic Editor X tools of the MCP server The MCP tools, resources and prompt; the admin token that calls Strapi's /mcp needs this action (2.5)

Uploads also need the Media Library action plugin::upload.assets.create. Version history and collaboration also apply the Content Manager permissions of the document: read access (including conditions such as "is creator", locale and field permissions) to list versions and join a room, update access to save versions, restore and type. A document you cannot read answers 404, the same as a document that does not exist.

Super Admins have all actions. The access action keeps its 1.x id, so roles that had it keep using the editor. The 2.4 actions (audit.read, suggestions.create, suggestions.review) are not given to any other role automatically.

Routes

All routes are admin routes served at /magic-editor-x/... and need an admin session (Authorization: Bearer <admin JWT>). There are no Content API routes; the Content API output of your own types is described in Content API and GraphQL output. Errors use the Strapi envelope { "data": null, "error": { "status", "name", "message", "details" } }; validation errors carry details.fieldErrors keyed by field path. Editor.js tool routes answer { "success": 0, "message" } on errors, as the tools expect.

Method Path Actions Body / query Response
GET /magic-editor-x/config access { data: { collaboration, ai, grammar, uploads, linkPreview, quality, comments, rawHtml, codeBlocks, permissions } }
GET /magic-editor-x/link access ?url= { success: 1, link, meta }
POST /magic-editor-x/image/byFile access, upload multipart image { success: 1, file: { url, ... } }
POST /magic-editor-x/image/byUrl access, upload { url } { success: 1, file }
POST /magic-editor-x/media/byUrl access, upload { url, kind: 'video' | 'audio' | 'track' } { success: 1, file: { url, id, documentId, name, mime, ext, hash, size } }; 413 too large, 415 type or file signature, 429 more than 3 downloads at once (2.4)
POST /magic-editor-x/file/upload access, upload multipart file { success: 1, file: { url, name, title, size, extension } }
GET /magic-editor-x/content-types access { data: [{ uid, kind, displayName, attributes }] } (types you can read)
GET /magic-editor-x/links/types access { data: [{ uid, kind, displayName, localized }] } (API types you can read)
GET /magic-editor-x/links/search access (+ Content Manager read) ?uid=api::x.y&q=&locale=&page= (q up to 100 characters) { data: [{ documentId, uid, locale, title, href, status? }], meta: { pagination } } (up to 20 readable entries; unknown or unreadable type 404)
GET /magic-editor-x/custom-blocks access (?all=true also needs custom-blocks.manage) ?all=true { data: [block] }
GET /magic-editor-x/custom-blocks/export custom-blocks.manage { data: { format: 'magic-editor-x/custom-blocks', version: 2, exportedAt, blocks } }
POST /magic-editor-x/custom-blocks/import custom-blocks.manage export document { data: { created: [name], skipped: [{ name, reason }] } }
PUT /magic-editor-x/custom-blocks/order custom-blocks.manage { ids } (every block once) { data: [block] }
POST /magic-editor-x/custom-blocks custom-blocks.manage block definition 201 { data: block }
PUT /magic-editor-x/custom-blocks/:id custom-blocks.manage full block definition { data: block }
DELETE /magic-editor-x/custom-blocks/:id custom-blocks.manage { data: { id } }
POST /magic-editor-x/custom-blocks/:id/duplicate custom-blocks.manage 201 { data: block }
GET /magic-editor-x/templates access (all=true: templates.manage) ?uid&field or ?all=true { data: [template] } (enabled templates offered in the field; unknown or unreadable field 404)
GET /magic-editor-x/templates/targets access, templates.manage { data: [{ uid, displayName, field, preset }] }
PUT /magic-editor-x/templates/order access, templates.manage { ids } { data: [template] }
GET /magic-editor-x/templates/:id access { data: template } (disabled ones only for managers; synced sources always)
GET /magic-editor-x/templates/:id/usage access, templates.manage { data: { entries, fields, templates, complete } } (synced sources: how often they are referenced, counts only)
GET /magic-editor-x/templates/:id/versions access, templates.manage { data: [{ id, version, trigger, label, name, createdAt, createdBy, blockCount }] } (synced sources only, newest first; 2.4)
GET /magic-editor-x/templates/:id/versions/:versionId access, templates.manage { data: { ...version, content } }
PUT /magic-editor-x/templates/:id/versions/:versionId access, templates.manage { label } (up to 120 characters, '' or null clears) { data: version }
POST /magic-editor-x/templates/:id/versions/:versionId/restore access, templates.manage { data: template } (saves the source with the version's blocks and name; a new version is stored)
POST /magic-editor-x/templates access, templates.manage { name, description?, kind, blocks, scope, enabled? } 201 { data: template }
PUT /magic-editor-x/templates/:id access, templates.manage full definition { data: template }
DELETE /magic-editor-x/templates/:id access, templates.manage { data: { id } }
POST /magic-editor-x/templates/:id/duplicate access, templates.manage 201 { data: template } (disabled copy)
POST /magic-editor-x/collaboration/session access, collaborate { uid, documentId, locale?, field, initialValue? } { data: { token, path, canEdit, expiresAt } }
GET /magic-editor-x/history access ?uid&documentId&locale&field { data: [version], meta: { canRestore, canCreate } }
GET /magic-editor-x/history/:id access { data: { ...version, content } }
POST /magic-editor-x/history access { uid, documentId, locale?, field, content, label? } 201 new version, 200 with meta.created: false when unchanged (a label then names the latest version)
PUT /magic-editor-x/history/:id access (+ Content Manager update) { label } (up to 120 characters, '' or null clears) { data: version }; 403 for read-only access, 404 without read access
POST /magic-editor-x/quality/links access (+ Content Manager read per type, Media Library read) { internal?: [{ uid, documentId, locale? }] (max 100), media?: [id] (max 100), external?: [url] (max 20) } { data: { internal: [{ uid, documentId, locale, status }], media: [{ id, status }], external: [{ url, status, code? }] } }; 429 above qualityChecks.externalLinks.perMinute
GET /magic-editor-x/quality/link-report access (+ Content Manager read on the field) ?uid&documentId&locale&field { data: { enabled, lastRun, draft, published } } (last scheduled check of the field)
GET /magic-editor-x/quality/link-schedule settings.read { data: { enabled, scheduled, rule, tz, nextRunAt, maxUrlsPerRun, perMinute, perHostConcurrency, running, lastRun } } (tz, nextRunAt 2.4)
POST /magic-editor-x/quality/link-schedule/run settings.read, settings.update 202 { data: { started: true } }; 409 RUNNING; 400 DISABLED
GET /magic-editor-x/comments access, comments.read (+ Content Manager read) ?uid&documentId&locale&field { data: [thread], meta: { counts, canWrite, canModerate } }
POST /magic-editor-x/comments access, comments.read, comments.write (+ Content Manager read) { uid, documentId, locale?, field, fieldKey?, blockId, body (1-4000), excerpt?, anchor?, mentions? } (anchor: { path, start, end, quote: { exact, prefix, suffix } } for a comment on selected text; mentions: up to 20 ids from /comments/mentionable) 201 { data: thread }, meta.droppedMentions; 429 above comments.perMinute
POST /magic-editor-x/comments/:id/replies access, comments.read, comments.write (+ Content Manager read) { body } 201 { data: comment } (reopens a resolved thread)
PUT /magic-editor-x/comments/:id access, comments.read, comments.write (+ Content Manager read) { body } { data: comment }; author only (403)
POST /magic-editor-x/comments/:id/resolve access, comments.read, comments.write (+ Content Manager read) { data: { id, status, resolvedAt, resolvedBy } }
POST /magic-editor-x/comments/:id/reopen access, comments.read, comments.write (+ Content Manager read) { data: { id, status, resolvedAt, resolvedBy } }
DELETE /magic-editor-x/comments/:id access, comments.read (+ Content Manager read) { data: { id, removed } }; others' comments need comments.moderate (403)
GET /magic-editor-x/comments/mentionable access, comments.read, comments.write (+ Content Manager read) ?uid&documentId&locale&field&fieldKey?&q? (q up to 50 characters) { data: [{ id, name }] } (up to 8 people who can read the field; opaque ids, never e-mail addresses); 429 above comments.mentionsPerMinute
GET /magic-editor-x/notifications access, comments.read ?page&pageSize&unread (pageSize 1-50, default 10) { data: [{ id, kind: 'mention' | 'reply', read, createdAt, threadId, actor, snippet, excerpt, target }], meta: { unread, pagination } } (your own, only for entries you can still read)
POST /magic-editor-x/notifications/read-all access, comments.read { threadIds? } (up to 100; without: all) { data: { updated } }
POST /magic-editor-x/notifications/:id/read access, comments.read { data: { id, read: true } }; 404 for someone else's
POST /magic-editor-x/notifications/:id/unread access, comments.read { data: { id, read: false } }; 404 for someone else's
GET /magic-editor-x/suggestions access (+ suggestions.create or suggestions.review, Content Manager read) ?uid&documentId&locale&field&fieldKey?&status (open default, or all) { data: [suggestion], meta: { counts: { open, accepted, rejected }, canCreate, canReview, fieldKey } }
POST /magic-editor-x/suggestions access, suggestions.create (+ Content Manager read) { uid, documentId, locale?, field, fieldKey?, note?, suggestions: [1-50 of { op: 'update', blockId, proposed, baseHash } | { op: 'insert', blockId, afterBlockId, proposed } | { op: 'delete', blockId, baseHash }] } 201 { data: [suggestion], meta: { created, updated } }; 400 PRESET_VIOLATION, TOO_MANY_SUGGESTIONS; 429 above suggestions.perMinute
POST /magic-editor-x/suggestions/:id/accept access, suggestions.review (+ Content Manager update) { outdated? } { data: suggestion } with the cleaned proposed block; 409 ALREADY_DECIDED
POST /magic-editor-x/suggestions/:id/reject access, suggestions.review (+ Content Manager update) {} { data: suggestion }; 409 ALREADY_DECIDED
DELETE /magic-editor-x/suggestions/:id access, suggestions.create { data: { id } } (your own open suggestion; 403 otherwise)
POST /magic-editor-x/ai/:action access, ai.use { text, language?, tone?, target: { uid, field } } { data: { text } }; 403 when the field turns AI off
POST /magic-editor-x/ai/image/alt-text access, ai.use (+ Media Library read) { target: { uid, field }, fileId, locale? } { data: { text } }; 503 unless "Send images" is on
POST /magic-editor-x/ai/field/:action access, ai.use { target, segments: [{ blockId, path, html }], language? } { data: { segments } } or { data: { text } }
POST /magic-editor-x/ai/blocks/:action access, ai.use { target: { uid, field }, segments: [{ blockId, path, html }] (1-200), language?, tone? } (improve, shorten, translate, tone) { data: { segments } }; 403 disableAi, 413, 502 BAD_RESPONSE, 503 DISABLED (2.4)
POST /magic-editor-x/grammar/check access, grammar.use { target, segments, locale? } { data: { language, matches, truncated } }
GET /magic-editor-x/settings settings.read { data: { ai, languageTool, coreBlocks, environment } } (no secrets)
PUT /magic-editor-x/settings settings.read, settings.update { ai: { enabled, provider, baseUrl, model, maxInputChars, maxOutputTokens, allowImages?, allowFieldActions?, apiKey? }, languageTool?: { enabled, baseUrl, username, level, apiKey? }, coreBlocks?: { enabled } } { data: { ai, languageTool, environment } }
POST /magic-editor-x/settings/ai/test settings.read, settings.update { ai: {...} } { data: { ok: true } }
POST /magic-editor-x/settings/language-tool/test settings.read, settings.update { languageTool: {...} } { data: { ok: true } }
GET /magic-editor-x/audit audit.read (field: + Content Manager read, 404; all documents: + settings.read, 403) ?uid&documentId&locale&field&fieldKey&actor&event&from&to&page&pageSize (pageSize 1-100, default 25) { data: [event], meta: { scope: 'field' | 'global', enabled, pagination } }, newest first (2.4)
GET /magic-editor-x/audit/actors audit.read, settings.read { data: [{ id, name }] } (people in the trail, up to 200)
POST /magic-editor-x/presence access (+ Content Manager read) { uid, documentId, locale?, tabId, idle?, leave? } { data: { enabled, softLock, canEdit, editors: [{ id, name, color, idle, live }] } }; names only (2.5)
GET /magic-editor-x/entry-summary access (+ Content Manager read) ?uid&documentId&locale { data: { fields, comments, quality, links } }: open threads, issues and broken links per readable field (2.5)
GET /magic-editor-x/widgets/open-threads access, comments.read ?pageSize (1 to 20) { data: [{ threadId, started, mentioned, excerpt, updatedAt, target }], meta: { more } } (2.5 homepage widget)
GET /magic-editor-x/widgets/broken-links access ?pageSize (1 to 20) { data: [{ problems, target }], meta: { enabled, lastRun, more, truncated } } (2.5 homepage widget; entries you can read)
GET /magic-editor-x/reuse/types access { data: [{ uid, kind, displayName, localized, locales }] }: types with an editor field and an entry you can read (2.5)
GET /magic-editor-x/reuse/source access (+ Content Manager read on document, locale and field) ?uid&documentId&locale&field { data: { uid, documentId, locale, title, status: 'draft', fields: [{ field, fieldKey, preset, blockCount, truncated, blocks }] } } (2.5)
POST /magic-editor-x/media/signed-urls access (+ Content Manager read when target is sent) { target?, urls: string[1..100] } { data: { private, urls: { <url>: <signed url> } } } (2.5, private upload providers)

upload means plugin::upload.assets.create.

Fields inside repeatable components and dynamic zones (2.4): GET /history, POST /history, GET /comments, POST /comments, GET /comments/mentionable, GET /suggestions, POST /suggestions, POST /collaboration/session and GET /quality/link-report accept an optional fieldKey next to field, and GET /history and GET /comments return meta.fieldKey. Writes for such a field whose stored value has no key yet answer 409 FIELD_KEY_REQUIRED (save the entry once); versions and threads saved by position before 2.4 that could not be mapped to an entry are listed under meta.positionalVersions / meta.positionalThreads and answer 409 POSITIONAL_READ_ONLY to changes. AI actions: improve, grammar, shorten, expand, summarize, simplify, translate (with language), tone (with tone), continue. Provider problems answer with name: 'AIProviderError' and details.code: DISABLED, NOT_CONFIGURED, NO_API_KEY (503), AUTH_FAILED (502), PROVIDER_RATE_LIMIT (503), TIMEOUT (504), REFUSED (422), PROVIDER_ERROR (502, the provider answered with another error status), UNREACHABLE (502, no connection or the base URL was refused), BAD_RESPONSE (502, not JSON or not the expected shape), RESPONSE_TOO_LARGE (502, the answer is over 1 MiB) and EMPTY (502, no text in the answer). Too long text answers 413, too many requests 429.

Example: save a version.

POST /magic-editor-x/history
Authorization: Bearer <admin JWT>
Content-Type: application/json

{ "uid": "api::article.article", "documentId": "k9d2w4xq8m1n0p3r5t7v9b1c", "locale": "en", "field": "body",
  "content": { "blocks": [{ "id": "a1", "type": "paragraph", "data": { "text": "Hello" } }] } }
{
  "data": {
    "id": "s8f2k1x0w9q7e5r3t1y6u4i2",
    "version": 3,
    "trigger": "manual",
    "createdAt": "2026-11-11T09:30:00.000Z",
    "createdBy": "Anna Beispiel",
    "stats": { "blocks": 1, "words": 1, "characters": 5 },
    "restorable": true
  },
  "meta": { "created": true }
}

Security and privacy

  • Core Blocks bridge (2.7, off by default): only block types registered in server code are accepted, each by its own Yup schema; built-in and unregistered nodes are validated by Strapi unchanged. Custom nodes are size-, depth- and key-checked before any schema runs and validated on a copy, so a schema cannot change stored data. Failures of the bridge reject the write instead of accepting it. Review: security-audit-2.7.md.

  • Stored content: every Magic Editor X value is normalised and sanitised on save by a Document Service middleware (Content Manager, Content API, imports and code). Unknown keys of known block types are dropped, URLs are checked, inline HTML is limited to the tags above and the raw HTML block follows rawHtml. Values over 5 MiB, with more than 5000 blocks or nested deeper than 24 levels are rejected with 400, never truncated. The admin sanitises again before rendering (DOMPurify with the same rules).

  • Outgoing requests: the plugin sends nothing on its own; there is no telemetry. What leaves the server, and when:

    Request When What is sent
    Link preview, image by URL An editor adds a link card or an image by URL (linkPreview.enabled for link cards) A GET request to that URL
    Video and audio by URL (2.4) An editor pastes a video or audio element and may upload A GET request to the file, its poster and its caption tracks
    Manual link check An editor presses "Check links" and qualityChecks.externalLinks.enabled is on HEAD (or a capped GET) to each external URL of the field
    Scheduled link check The cron rule fires and qualityChecks.externalLinks.schedule.enabled is on HEAD (or a capped GET) to external URLs of all editor fields, within the run's budget
    AI assistant An editor runs an action on selected text, after the owner configured a provider The selected text and a fixed instruction
    AI alternative text An editor asks for a suggestion and the owner turned on "Send images to the AI provider" One image file (at most 1568 px on the long edge, 3.5 MB) and the content language
    AI for the whole field An editor translates or summarizes and the owner turned on whole-field actions The inline text of every block in the field (no images, files or other block data)
    AI for chosen blocks (2.4) An editor runs an action on chosen blocks, after the owner configured a provider The inline text of those blocks
    Mention e-mail (2.4) Someone is mentioned and the owner set comments.notifications.email: true An e-mail through your Strapi email plugin: who mentioned you, the entry title, an admin link
    Grammar check (LanguageTool) An editor presses "Check grammar" and the owner turned LanguageTool on The plain text of every block in the field and its language, to the configured LanguageTool server

    Link previews, images and media by URL and the link checks only fetch public http(s) addresses: the host is resolved once, every address must be public, the connection is pinned to that address, redirects are re-checked (at most 3), and size, type and time are limited. AI and LanguageTool base URLs must be public https URLs unless ai.allowPrivateBaseUrl or languageTool.allowPrivateBaseUrl is on; origins on private networks need qualityChecks.externalLinks.allowPrivateOrigins (link checks), uploads.allowPrivateOrigins (images and media by URL) or ai.altText.allowPrivateOrigins (alt text images); redirects from them are never followed, and link-local and cloud metadata addresses stay refused, also after DNS resolution.

  • Uploads are checked by their first bytes (not by the file name or the browser's MIME type) and stored through the Media Library with the admin as creator. The stored file extension follows the detected type (a PNG named photo.html is stored as photo.png); image routes accept raster images only (no SVG or HTML), and the Media Library's plugin::upload.security allowedTypes/deniedTypes apply (a refused type answers 415). Images whose data cannot be decoded answer 400 on all three upload routes: PNG by its chunk checksums, JPEG, GIF, WebP and AVIF with the Media Library's own sharp check (isImage and isFaultyImage), also when they are uploaded as attachments.

  • Collaboration: tokens are signed, bound to admin, document, locale and field, expire after collaboration.tokenTtlSeconds and work once on any process; the socket accepts the admin and server origins and collaboration.allowedOrigins and only clients of the current protocol; every update is checked (allowed structures only, no prototype keys, dependencies present, touched blocks valid) before it is stored or relayed, and a socket that keeps sending invalid updates is closed; names and colours of other people come from the server, never from a client; remote content is sanitised before the editor renders it; updates, sessions, sockets and rooms per admin are rate limited; viewers cannot write. See docs/security-audit-2.1.md.

  • Field presets are enforced on the server (save middleware and realtime guard), not only in the editor; see Field presets.

  • Paste, import and rendering: pasted and imported HTML/Markdown is parsed into an inert document and rebuilt from the editor's own tags only, then sanitised again on save; magic-editor-x/render re-parses stored inline HTML and never trusts it. The link check fetches external URLs only when the owner turns it on, through the SSRF-protected fetcher, rate limited, without logging URLs. See docs/security-audit-2.2.md.

  • Content API and GraphQL output (2.3): ?mex= and the GraphQL fields resolve internal links, mentions, embedded entries, media and synced blocks with the caller's own permissions (find on the target type, upload find for media), read published versions unless the request asks for drafts, and pass every row through Strapi's output sanitising. Targets the caller may not read are handled like missing ones, so the output reveals neither their existence nor their titles or slugs. Without ?mex the response is the stored value, which still carries stored hrefs and embedded-entry snapshots, as in 2.2.

  • React and Vue components (2.3) use the same render tree as renderHtml; text is rendered as text and raw HTML only through your sanitizeRaw. The XSS corpus is rendered through all three outputs in the tests.

  • Comments, templates and synced blocks (2.3): comment routes check the plugin actions and Content Manager read on the document, locale and field (404 otherwise); admin ids are never returned; comment text is plain text. Templates and synced sources are cleaned with the field sanitiser on every write and filtered by the field preset when inserted or expanded; a synced source cannot contain another synced block. Synced sources have no Draft & Publish, so an edit is live in published output at once.

  • 2.4 surfaces: field keys come from the server, are checked against the stored draft and never decide access on their own; legacy rows are mapped only on block-id evidence and are otherwise read-only. Table merges, alignment and captions are validated and bounded on save and on the live channel. Math is rendered by Temml with trust: false and every renderer passes MathML through an allow-list (no links, styles, ids or event handlers); footnote notes follow the inline policy. Comment anchors, mentions and notifications are checked server-side (Content Manager read on the field for every mentioned person, ids only in notification rows, e-mails without comment text and with header-safe names). Suggestions are sanitised and preset-checked, decided once (conditional updates) and need update access to accept. The audit trail holds no content. AI translations by Strapi receive only text. See docs/security-audit-2.4.md.

  • Secrets: the AI key and the LanguageTool key are encrypted with AES-256-GCM (random IV, versioned format, separate key derivation per purpose) and never returned. Changing the AI provider or base URL, or the LanguageTool base URL or user name, requires entering the key again, so a stored key cannot be sent to another host. The ai.apiKey key from the config is only sent to ai.apiKeyBaseUrl (unset: the official Anthropic and OpenAI APIs); a settings admin who points the provider at another base URL has to enter a key for it.

  • Logs contain operation names and error codes only, never content, URLs with queries, tokens, user ids or email addresses.

  • Stored data: custom block definitions, versions (field content and the admin who saved it), live rooms (Yjs updates, removed collaboration.roomTtlMinutes after the last person left), presence rows (admin display name, colour, caret position; removed when the socket closes or after missed heartbeats), comments (text, author id and display name; deleted with the document locale, anonymised when the admin is deleted), templates, patterns and synced sources (with the creator's display name) and their versions (with the saver's name), suggestions (proposed blocks, author and decider names; deleted with the document locale, anonymised when the admin is deleted), notifications (ids only), the audit trail (event, target, counts, block ids, admin id and name; pruned after audit.retentionDays) and, with the scheduled link check, the external URLs of editor fields with their last status.

  • Reviews: docs/security-audit-2.4.md covers every 2.4 surface (findings MEX-24-01 to MEX-24-18), docs/security-audit-2.3.md every 2.3 surface (MEX-23-01 to MEX-23-15), each with controls, tests and residual risks.

  • Content Security Policy: Editor.js and the Design System add inline styles, which Strapi's default style-src 'unsafe-inline' allows. The socket connects to the same origin as the admin, which connect-src 'self' covers; add the wss: origin only when the admin runs on another host. Embeds and external images in the editor preview need frame-src and img-src sources; see Content Security Policy below.

Report vulnerabilities privately through GitHub security advisories on the repository.

Content Security Policy

Strapi's default admin CSP (strapi::security) has no frame-src, so embed iframes fall back to default-src 'self', and its img-src allows only 'self', data:, blob: and market-assets.strapi.io. YouTube, Vimeo and the other embeds, and images from other hosts (for example link preview images), are therefore blocked in the editor preview. The stored content is not affected and your frontend has its own CSP.

The plugin never changes the CSP. Instead:

  • Settings > Magic Editor X > Configuration shows a "Content Security Policy" notice when sources are missing: what is blocked and the exact config/middlewares.js snippet, with a copy button. The server reads the effective strapi::security configuration once at startup (string and object entries, useDefaults, frame-src, child-src, default-src, img-src) and returns it in GET /magic-editor-x/settings as data.environment.csp ({ active, frameSrcMissing, imgSrcMissing, snippet }). Only CSP sources are returned; browsers receive them in every response header anyway.
  • In the editor, a blocked embed or image is replaced by a placeholder inside the block ("This embed is blocked by your Content Security Policy.") with a link to the settings page for admins who can read the settings. The block data is saved unchanged.

The snippet for Strapi's defaults (merge it into your existing strapi::security entry and keep your other directives, for example the hosts of your upload provider; Strapi merges arrays with its defaults by position):

// config/middlewares.js
module.exports = [
  // ...other middlewares
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'frame-src': [
            "'self'",
            'https://www.youtube.com',
            'https://player.vimeo.com',
            'https://platform.twitter.com',
            'https://www.instagram.com',
            'https://codepen.io',
            'https://imgur.com',
            'https://assets.pinterest.com',
            'https://miro.com',
            'https://www.figma.com',
            'https://www.facebook.com',
          ],
          'img-src': ["'self'", 'data:', 'blob:', 'https://market-assets.strapi.io', 'https:'],
        },
      },
    },
  },
  // ...other middlewares
];

Add only the services you use. Instead of https: in img-src you can list your image hosts; the notice then counts external images as allowed. GitHub gist embeds load a data: iframe that inherits the admin CSP and needs a remote script, so they stay blocked under a strict policy, and Imgur's embed URL uses http:, which an https admin blocks as mixed content.

Troubleshooting

Symptom Cause Fix
The field shows "The editor could not be loaded." The role lacks plugin::magic-editor-x.access, or the server is unreachable Grant the action; check the server log.
No upload or "You do not have permission to upload files" The role lacks plugin::upload.assets.create Grant Media Library create to the role.
No version history (clock) button The entry was never saved Save the entry once.
Badge shows "Live editing unavailable" No collaborate action, no read access to the document, or collaboration.enabled: false Grant the action or check the Content Manager permissions.
Badge stays at "Connecting" or "Reconnecting" The proxy does not forward WebSocket upgrades on collaboration.path, or the origin is not allowed Allow upgrades on the path; add the admin origin to collaboration.allowedOrigins when the admin runs on another host.
"Reload the page to keep editing live" The browser still runs the admin of an older version after an update Reload the page.
Settings say the API key cannot be stored MAGIC_EDITOR_X_ENCRYPTION_KEY is missing or shorter than 32 characters Set the variable and restart, or use ai.apiKey.
Settings say the stored key is unreadable The encryption key changed Enter the provider key again.
"Block node is of invalid type" when saving an entry with a custom block in a Strapi Blocks field Strapi does not know the block type: the Core Blocks bridge is off, or the type is not registered on the server Register the type with service('core-blocks').register() and turn the bridge on in Settings.
Settings show the Core Blocks bridge as "Not available" The running Strapi changed the validator the bridge hooks into; the server log has one error with the reason Update Magic Editor X; until then custom blocks are rejected as before.
AI error "The AI provider rejected the key." Wrong key for this provider Enter the key again and use Test connection.
AI error "The AI provider key is missing" (NO_API_KEY) or the key field asks for a key although ai.apiKey is set The settings point at another base URL than the one ai.apiKey is configured for Set ai.apiKeyBaseUrl in config/plugins to that base URL, or enter a key for it in the settings.
Startup error [magic-editor-x] invalid configuration for: <key> Wrong type or range in config/plugins Fix the named key (see the reference table).
400 "A Magic Editor X field contains invalid content" The value is not editor JSON, too large or too deep Send an Editor.js object within the limits.
400 "A Magic Editor X field does not match its field settings" The content breaks the field's preset (details.violations lists rule codes and block ids) Open the quality panel of the field and use Fix automatically, or change the content or the field options.
400 "Quality checks failed for a Magic Editor X field" on publish The field has publishGuard and the quality checks report errors Fix the errors listed in the quality panel (missing alternative texts, empty links).
400 with details.param: 'mex' from the Content API mex has another value than html, text, markdown or json, or is repeated Send one of the four values once.
?mex=html shows link text without the link The caller may not read the linked entry, it is missing, or it has no published version Grant find on the target type to the token or role, publish the entry, or request status=draft where appropriate.
A synced block renders nothing in my frontend Without ?mex the API returns only { ref }; the renderers need the sources Use ?mex= or the GraphQL fields, or pass the sources with the synced render option.
"Synced block removed" in the editor Its source was deleted in Settings > Templates Delete the block, or insert another synced block.
No Comments or Check grammar button Comments: the role lacks comments.read, comments.enabled is false, or the entry was never saved. Grammar: the role lacks grammar.use, or LanguageTool is off or has no base URL Grant the action, save the entry once, or turn the feature on.
"Alternative text suggestions are turned off." "Send images to the AI provider" is off (503 IMAGES_DISABLED) Turn it on in Settings > Magic Editor X > Configuration, if you accept that images are sent.
"The grammar check is not configured yet." LanguageTool is on but has no base URL Enter the base URL and use Test LanguageTool.
Startup error invalid configuration for: qualityChecks.externalLinks.schedule.enabled The schedule is on but qualityChecks.externalLinks.enabled is off Turn on both, or neither.
Strapi does not start, NAME_TAKEN A block registered with the SDK has the same name as a Settings custom block Rename one of them.
"Save the entry once to turn on history and comments for this section." A new section in a repeatable component or dynamic zone has no fieldKey yet (409 FIELD_KEY_REQUIRED from the API) Save the entry.
"Older versions saved by position" or "Older comments saved by position" Rows from before 2.4 that could not be matched to one entry by their block ids View or compare them; they cannot be restored or changed (409 POSITIONAL_READ_ONLY).
Content API ?status=published create or update answers 400 QUALITY_GATE Since 2.4 the publishing guard also checks writes that publish directly Fix the errors in the guarded field, or save as draft and publish after fixing.
A Strapi AI translation of one locale failed with AI_TRANSLATION_UNSAFE The source value of a Magic Editor X field could not be matched (for example more repeatable entries than the source has) Align the entries with the source locale and translate again, or fill the locale by hand.
No Suggest changes or Suggestions entry The role lacks suggestions.create / suggestions.review, suggestions.enabled is false, or the field is a new section that was never saved Grant the action, turn the feature on, or save the entry once.
Mention e-mails do not arrive comments.notifications.email is off, the Strapi email plugin has no working provider, or the hourly limit per person was reached Turn it on, configure the email provider (Settings > Configuration shows whether e-mails are on).
Settings > Audit trail answers 403 Listings across documents need settings.read next to audit.read Grant both, or use the Activity tab of a field.

Upgrading from 2.6

2.7 is a minor release with no breaking changes and no migration. The Core Blocks bridge is off by default, so nothing changes until an admin turns it on and a developer registers block types (see Core Blocks bridge). GET /settings adds data.coreBlocks (status and registered type names, no content); PUT /settings accepts an optional coreBlocks: { enabled }.

Upgrading from 2.5

2.6 is a minor release. Stored content, routes and configuration keep working; there are no breaking changes and no migration.

  1. Update and rebuild the admin: npm install magic-editor-x@latest && npm run build.
  2. Nothing else is required. Component blocks appear only in fields that list components; columns appear in the + menu of fields whose preset allows them; block attributes for Live Preview are off until you pass blockIds or mexBlockIds=true.

What changes for existing data and clients:

  • component and columns are built-in block names now. A Settings custom block with one of these names from before 2.6 keeps its data, its editor tool and its output; new custom blocks cannot take the names.
  • If your site styles a custom block by the class mex-columns, select the built-in block with [data-mex-columns].
  • GET /config adds data.components (schemas of the app's components, no content).

Upgrading from 2.4

2.5 is a minor release. Stored content, routes and configuration keep working; there are no breaking changes.

  1. Update and rebuild the admin: npm install magic-editor-x@latest && npm run build.
  2. Nothing else is required. New features are off by default or appear only when they are relevant: the entry panel shows only when there is something to show, local drafts only when there is something to restore, colours and annotations only in fields that turn them on, MCP only with mcp.enabled: true.
  3. Optional: presence.softLock: true, a palette, the new action plugin::magic-editor-x.mcp.use for admin tokens of AI clients (no role gets it automatically).

What changes for existing data and clients:

  • With a private upload provider, media in Magic Editor X values gets a fileId once at startup (migration 2.5.0-media-file-ids, idempotent; npx magic-editor-x media-file-ids [--apply]) and Content API output carries freshly signed URLs. Stored values never contain signatures.
  • Fields start when they come near the screen. Scripts and tests that wait for [data-mex-ready="true"] must scroll the field into view first, or run with lazyInit.enabled: false.
  • Mention e-mails use the recipient's admin language.
  • A field emptied and saved keeps its fieldKey (the value stays null), and discarding a draft whose published version predates 2.4 keeps the keys.
  • Editor.js stays at 2.31.7.

Upgrading from 2.3

2.4 is a minor release. Stored content, routes and configuration keep working; there are no breaking changes.

  1. Update and rebuild the admin: npm install magic-editor-x@latest && npm run build.
  2. Grant the new actions to roles that need them: suggestions.create, suggestions.review, audit.read. No role gets them automatically.
  3. Optional: comments.notifications.email: true (needs a working Strapi email provider), qualityChecks.externalLinks.schedule.tz, uploads.allowPrivateOrigins, ai.altText.allowPrivateOrigins. The audit trail is on by default (audit.enabled, 180 days); set audit.enabled: false if you do not want it.

What changes for existing data and clients:

  • Values inside repeatable components and dynamic zones get a fieldKey the next time they are saved. API clients that write such values should send the key back (or send the component id); otherwise each write gives them a new key and their history, comments and live room start fresh.
  • Versions and comments that 2.3 stored for such fields by position are mapped to their entry when their block ids prove it, the first time someone opens that field's history or comments. The rest stay readable but read-only. Nothing is deleted.
  • Tables use the plugin's own table tool instead of @editorjs/table. Stored tables are unchanged, and tables without the new keys render exactly as before.
  • Content API writes with ?status=published now run the publishing guard (400 QUALITY_GATE for fields with publishGuard and errors).
  • A block registered in code with the name math keeps working; Settings custom blocks named math from before 2.4 keep their data, and new ones cannot take the name.
  • Editor.js stays at 2.31.7.

Upgrading from 2.2

2.3 is a minor release. Stored content, routes and configuration keep working.

  1. Update and rebuild the admin: npm install magic-editor-x@latest && npm run build.
  2. Grant the new actions to roles that need them: comments.read, comments.write, comments.moderate, templates.manage, grammar.use.
  3. Optional: turn on the AI image and whole-field switches and LanguageTool in Settings, and the scheduled link check (qualityChecks.externalLinks.enabled and qualityChecks.externalLinks.schedule.enabled, plus cron: { enabled: true } in config/server).
  4. Optional: use ?mex= or the GraphQL fields, or the React and Vue components, in your frontend.

A custom block named toc, gallery, video, audio, synced or mention that you created before 2.3 keeps working as a custom block, with its stored data unchanged; new custom blocks cannot use these names.

Migrating from 1.x

2.0 is a major release. Stored content keeps working; routes, permissions and configuration changed. The full guide is in the CHANGELOG. In short:

  1. Update the package and rebuild the admin: npm install magic-editor-x@2 && npm run build.
  2. Remove 1.x configuration keys (enabledTools, linkPreviewTimeout, maxImageSize, maxFileSize, allowedImageTypes, collaboration.wsPath, wsUrl, sessionTTL, allowedAdminRoles, allowedAdminUserIds, cors) and use the new keys above.
  3. Grant the new actions to your roles: collaborate, ai.use, custom-blocks.manage, settings.read, settings.update. Collaboration grants from 1.x are replaced by Content Manager permissions; Strapi drops the old tables on the first start.
  4. If you used the AI assistant, configure your own provider in Settings > Magic Editor X > Configuration.
  5. If your raw HTML blocks need scripts or iframes, set rawHtml: 'allow'.

On the first start the plugin converts 1.x versions that only contained collaboration state and cleans custom block icons and templates. Both run once across all processes.

Development and tests

npm ci
npm run lint
npm run format:check
npm test                  # unit tests, no Strapi host needed
npm run test:admin        # admin entry points in React StrictMode (jsdom, no Strapi host needed)
npm run bench             # performance benchmark (500 to 5000 blocks) against fixed budgets
npm run build             # admin and server bundles, then a runtime check
npm run verify
MEX_HOST_URL=http://127.0.0.1:1421 MEX_CREDS=/path/to/creds.json npm run test:integration

npm run test:admin renders every admin entry point inside React.StrictMode with the providers of the Strapi admin, in jsdom with a fake network: the editor field (the real Editor.js, live collaboration against a fake socket, lazy start, signed-out state, version history, comments, templates, synced blocks), the entry side panel, the four settings pages, the three homepage widgets, the Content-Type Builder input and the Redux middlewares. It fails on a request sent twice, an Editor.js instance, Yjs document, socket, interval, listener or observer left after unmount, and any console error or warning. CI runs it on React 18 and, in a separate required job, on React 19.

docs/engine-decision.md records why the plugin stays on Editor.js for 2.x. CONTRIBUTING.md explains the isolated acceptance host, the integration suite on SQLite and PostgreSQL and the multi-process acceptance run. AGENTS.md is the contract for coding agents.

Maintenance status

Actively maintained. Releases are made with semantic-release from main; every release runs lint, tests, build, package verification and a production dependency audit first. Supported line: Strapi 5.

Languages

The admin is translated into English, German (formal Sie), French, Spanish and Portuguese.

Showcase your company

Using Magic Editor X in production? Add your company to the "Used by" section of the documentation site. The form asks for the company name, the website, a logo (PNG, JPEG or WebP, uploaded to the issue) and an optional one-line description.

A maintainer reviews every request and approves it with the showcase-approved label. .github/workflows/showcase.yml then validates the issue with .github/scripts/showcase.mjs, converts the logo to a WebP of at most 320 x 160 pixels and opens a docs: pull request that changes docs/site/showcase.json. The logo appears on the site after that pull request is merged. Website links carry rel="ugc noopener". To remove an entry, open an issue that names the company; a maintainer then applies the showcase-remove label.

License

MIT © 2025-2026 Schero D.

About

Free, MIT-licensed block editor for Strapi 5: live collaboration across servers, version history, custom blocks, Media Library uploads and an optional AI assistant with your own provider.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages