These integration guides are not official documentation and the Strapi Support Team will not provide assistance with them.
Why Use BlockNote?
Integrating BlockNote can bring an open-source, block-based rich text editor right into your apps. For those interested in creating a Notion-like application using Strapi, this integration offers a great starting point. Unlike traditional editors, BlockNote's block architecture treats each content element—paragraphs, headings, lists, images—as separate units, making document organization feel natural and intuitive.
This integration makes BlockNote ideal for apps where content quality and user experience matter. Leveraging the headless CMS benefits, integrating BlockNote with Strapi provides a modern approach to content management. Curious about implementation? Check out BlockNote's official website.
Why Use Strapi?
Strapi is the leading open-source headless CMS offering features, like customizable APIs, role-based permissions, multilingual support, etc. It simplifies content management and integrates effortlessly with modern frontend frameworks.
Explore the Strapi documentation for more details.
Strapi 5 Highlights
The out-of-the-box Strapi features allow you to get up and running in no time: 1. Single types: Create one-off pages that have a unique content structure. 2. Draft and Publish: Reduce the risk of publishing errors and streamline collaboration. 3. 100% TypeScript Support: Enjoy type safety & easy maintainability 4. Customizable API: With Strapi, you can just hop in your code editor and edit the code to fit your API to your needs. 5. Integrations: Strapi supports integrations with Cloudinary, SendGrid, Algolia, and others. 6. Editor interface: The editor allows you to pull in dynamic blocks of content. 7. Authentication: Secure and authorize access to your API with JWT or providers. 8. RBAC: Help maximize operational efficiency, reduce dev team support work, and safeguard against unauthorized access or configuration modifications. 9. i18n: Manage content in multiple languages. Easily query the different locales through the API. 10. Plugins: Customize and extend Strapi using plugins.
Learn more about Strapi 5 feature.
See Strapi in action with an interactive demo
Setup Strapi 5 Headless CMS
We are going to start by setting up our Strapi 5 project with the following command:
🖐️ Note: make sure that you have created a new directory for your project.
You can find the full documentation for Strapi 5 here.
Install Strapi
npx create-strapi-app@latest server
You will be asked to choose if you would like to use Strapi Cloud we will choose to skip for now.
Strapi v5.6.0 🚀 Let's create your new project
We can't find any auth credentials in your Strapi config.
Create a free account on Strapi Cloud and benefit from:
- ✦ Blazing-fast ✦ deployment for your projects
- ✦ Exclusive ✦ access to resources to make your project successful
- An ✦ Awesome ✦ community and full enjoyment of Strapi's ecosystem
Start your 14-day free trial now!
? Please log in or sign up.
Login/Sign up
❯ Skip
After that, you will be asked how you would like to set up your project. We will choose the following options:
? Do you want to use the default database (sqlite) ? Yes
? Start with an example structure & data? Yes <-- make sure you say yes
? Start with Typescript? Yes
? Install dependencies with npm? Yes
? Initialize a git repository? Yes
Once everything is set up and all the dependencies are installed, you can start your Strapi server with the following command:
cd server
npm run develop
You will be greeted with the Admin Create Account screen.
Go ahead and create your first Strapi user. All of this is local so you can use whatever you want.
Once you have created your user, you will be redirected to the Strapi Dashboard screen.
Publish Article Entries
Since we created our app with the example data, you should be able to navigate to your Article collection and see the data that was created for us.
Now, let's make sure that all of the data is published. If not, you can select all items via the checkbox and then click the Publish button.
Enable API Access
Once all your articles are published, we will expose our Strapi API for the Articles Collection. This can be done in Settings -> Users & Permissions plugin -> Roles -> Public -> Article.
You should have find
and findOne
selected. If not, go ahead and select them.
Test API
Now, if we make a GET
request to http://localhost:1337/api/articles
, we should see the following data for our articles.
🖐️ Note: The article covers (images) are not returned. This is because the REST API by default does not populate any relations, media fields, components, or dynamic zones.. Learn more about REST API: Population & Field Selection.
So, let's get the article covers by using the populate=*
parameter: http://localhost:1337/api/articles?populate=*
Getting Started with BlockNote
Pairing BlockNote with Strapi creates a content management powerhouse by swapping the standard editor for something more intuitive. Here's how to integrate BlockNote with Strapi. For more detailed steps, refer to this Strapi integration guide.
- Install BlockNote dependencies using npm or Yarn by adding the specific packages required for your project.
- To create a custom field structure in Strapi, develop it within a dedicated plugin. Ensure the plugin's directory includes both server and admin panel parts, and register the custom field in both areas to make it functional in Strapi's admin panel.
Code Implementation for BlockNote and Strapi Integration
Let's swap in BlockNote as your editor:
- Create a BlockNote editor component:
1import { BlockNoteView, useCreateBlockNote } from "@blocknote/react";
2import "@blocknote/core/style.css";
3
4function BlockNoteEditor({ onChange, name, value }) {
5 const editor = useCreateBlockNote({
6 initialContent: value,
7 onEditorContentChange: (editor) => {
8 onChange({ target: { name, value: editor.topLevelBlocks } });
9 },
10 });
11
12 return <BlockNoteView editor={editor} />;
13}
14
15export default BlockNoteEditor;
- Register your custom field in your plugin's
index.js
:
1import BlockNoteEditor from './components/BlockNoteEditor';
2
3export default {
4 register(app) {
5 app.addFields({ type: 'wysiwyg', Component: BlockNoteEditor });
6 },
7 bootstrap(app) {},
8};
- Update the plugin configuration in the appropriate file to enable the
blocknote-field
plugin:
1module.exports = ({ env }) => ({
2 'blocknote-field': {
3 enabled: true,
4 resolve: './src/plugins/blocknote-field',
5 config: {
6 // Your plugin configuration options
7 },
8 },
9});
This setup replaces Strapi's built-in editor with BlockNote, giving your content team a more flexible editing experience. The block-based approach feels familiar to anyone who's used Notion, making content creation more intuitive.
By leveraging TypeScript support, you can enjoy the benefits of TypeScript, such as improved code quality and developer tooling. These features are particularly beneficial for frontend developers and headless CMS, as they enhance the development workflow and user experience.
The React-based implementation makes it easier to integrate with a React Native app with Strapi, streamlining your development process across platforms. The modern UI with slash commands and drag-and-drop opens up possibilities for innovative JavaScript projects with Strapi.
By integrating BlockNote with Strapi, you're enhancing your content management system with a modern, powerful editor that boosts productivity and user satisfaction.
Strapi Open Office Hours
If you have any questions about Strapi 5 or just would like to stop by and say hi, you can join us at Strapi's Discord Open Office Hours Monday through Friday at 12:30 pm - 1:30 pm CST: Strapi Discord Open Office Hours
For more details, visit the Strapi documentation and BlockNote documentation.