@ckeditor/strapi-plugin-ckeditor

中文文档
1.1.2发布于 2026/02/16MIT近 30 天下载 1.4万

CKEditor 5 - Official Integration for Strapi

原始使用文档
文档目录6 节
  1. ✨ Features
  2. 🔧 Installation
  3. 🛠 Contributing
  4. Setting up the environment
  5. 🧩 Compatibility with Strapi versions
  6. ⚖️ Licensing

CKEditor 5 - Official Integration for Strapi

CKEditor 5 used inside Strapi. Article form consisting of a title, excerpt text, and content

[!IMPORTANT]
Starting from version 1.0.0, the CKEditor 5 custom field plugin is compatible with Strapi 5 and can’t be used in Strapi 4.4+. We decided to maintain integrations for both Strapi versions to ensure that you can still use our custom field before migrating to Strapi 5. Below is the compatibility table showing which plugin version should be used with your Strapi version.

This package provides a custom field for Strapi 5 that lets you use and configure CKEditor in no time.

Custom fields are supported since Strapi 4.4+ and offer powerful API to create highly customizable fields.

This is an official plugin, provided to you by the CKEditor team 👋

✨ Features

  • No code field customization: customize each field for its specific usage scenario – let it be short note, blog article, or a document.
  • Predefined editor presets: a couple predefined editor presets (sets of CKEditor 5 plugins and their configuration) to choose from.
  • Custom max length validation: Twitter-like length validation with visual indicators, based on the number of characters in the text, not the HTML string.
  • Dark mode support: because you like it.
  • Media library integration: inserting images directly from Strapi's media library.
  • More features coming soon: upload adapter integration, more granular editor toolbar and plugins configuration, and more.

🔧 Installation

[!IMPORTANT]
Before installation, make sure that you own a valid CKEditor 5 license key. Start a commitment-free trial to get instant access to the license key. You can also refer to our license key and activation guide to learn more.

Inside your Strapi app, add the package:

With npm:

npm install @ckeditor/strapi-plugin-ckeditor

With yarn:

yarn add @ckeditor/strapi-plugin-ckeditor

Then, add the Content Security Policy configuration to allow loading CKEditor 5 from https://cdn.ckeditor.com origin and sending the editor usage information to https://proxy-event.ckeditor.com, by adding the rule to config/middlewares.ts in your Strapi project root:

export default [
  // ...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'script-src': ['https://cdn.ckeditor.com'],
          'connect-src': ['https://proxy-event.ckeditor.com']
        },
      },
    },
  },
  // ...

Finally run build:

npm run build

or:

yarn build

🛠 Contributing

This section covers the way how to configure your environment if you want to contribute to this package.

Setting up the environment

In order to start making changes in the plugin you first need to install Strapi infrastructure on top of the plugin repository.

npx create-strapi-app --quickstart strapi
cd strapi

By default Strapi does not create plugins folder so we need to create it.

mkdir -p src/plugins

Now we should clone this repository so we can work on it.

git clone [email protected]:ckeditor/strapi-plugin-ckeditor.git src/plugins/strapi-plugin-ckeditor

Let's add an entry inside ./package.json file so, we won't need to use yarn inside plugin itself.

"workspaces": ["./src/plugins/strapi-plugin-ckeditor"]

Install dependencies:

yarn install

Now we need to register plugin so strapi can use it. In order to do that we need to create (if not already created) ./config/plugins.js file and add entry to it.

module.exports = ({ env }) => ({
  ckeditor: {
    enabled: true,
    resolve: "./src/plugins/strapi-plugin-ckeditor"
  },
});

Rebuild the project and start the server:

yarn build
yarn develop

🧩 Compatibility with Strapi versions

Starting from version 1.0.0, the CKEditor 5 custom field plugin is compatible with Strapi 5 and can't be used in Strapi 4.4+. We decided to maintain integrations for both Strapi versions to make sure that you still be able to use our custom field before migrating to Strapi 5. Below, you can find the compatibility table that shows which plugin version should be used with your Strapi version.

Plugin version Strapi version
1.x.x ≥ 5.0.0
0.x.x ≥ 4.4

⚖️ Licensing

The plugin "CKEditor 5 - Official Integration for Strapi" is licensed under MIT. Please note that CKEditor 5 itself is licensed under GPL v2+ or a commercial license.

版本与发布记录

@ckeditor/strapi-plugin-ckeditor 共发布 22 个版本,首次发布于 2022/09/28;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.1.2latest2026/02/168 个月前
0.2.22026/02/168 个月前
1.1.12025/03/171.6 年前
0.2.12025/03/171.6 年前
1.1.02024/12/021.9 年前
0.2.02024/12/021.9 年前

关于 @ckeditor/strapi-plugin-ckeditor 的常见问题

@ckeditor/strapi-plugin-ckeditor 是什么?

CKEditor 5 - Official Integration for Strapi

如何安装 @ckeditor/strapi-plugin-ckeditor?

在项目目录运行 npm install @ckeditor/strapi-plugin-ckeditor,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@strapi/strapi(^5.0.0 || ^5.0.0-beta || ^5.0.0-alpha || ^5.0.0-rc)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@ckeditor/strapi-plugin-ckeditor 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ckeditor__strapi-plugin-ckeditor 是否存在。

@ckeditor/strapi-plugin-ckeditor 可以商用吗?

@ckeditor/strapi-plugin-ckeditor 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ckeditor/strapi-plugin-ckeditor 的下载量有多少?

根据 npm 官方下载统计,@ckeditor/strapi-plugin-ckeditor 在 2026/10/10 – 2026/11/08 这 30 天内被下载 13,531 次,日均约 451 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ckeditor/strapi-plugin-ckeditor 还在维护吗?

最新版本 1.1.2 发布于 2026/02/16(8 个月前);至今共发布 22 个版本,其中过去 12 个月发布了 2 个;首次发布于 2022/09/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。