Almost EVERYONE who tried headless systems said they saw benefits. Download the state of CMS now!

Storyblok now on AWS Marketplace: Read more

O’Reilly Report: Decoupled Applications and Composable Web Architectures - Download Now

Empower your teams & get a 582% ROI: See Storyblok's CMS in action

Skip to main content

Creating Field Plugins

This tutorial will take you through the steps to create a new field plugin with Storyblok’s Field Plugin CLI.

Section titled Prerequisites Prerequisites

This tutorial requires the following applications to be installed on your machine:

Check if the dependencies are installed by running

node -v
yarn -v
npm -v
git --version

Section titled Create a Project Create a Project

To create a new project, run Storyblok’s field plugin command line interface. This will run a setup wizard, letting you choose between different options along the way. Open the terminal and run

npx @storyblok/field-plugin-cli@latest create

The first question asked is whether the new project should be a monorepo or its opposite – polyrepo. If you’re not familiar with what a monorepo is, choose polyrepo.

learn:

A monorepo is a software-development strategy in which the code for a number of projects is stored in the same repository. A polyrepo is the opposite – a repository with a single project.

Next, choose a package name, in this example, “training-field”.

Finally, select a template. There are several frameworks to choose from.

Wait for the package to be installed.

That should have generated a new directory, initialized git, and installed dependencies with Yarn.

Section titled Run Locally Run Locally

Navigate into the newly created directory.

cd training-field/

Start the application.

yarn dev

You will see the following result:

From the output in the terminal, open the Sandbox URL in your browser.

Here, you can view your field plugin during development.

learn:

The Plugin Sandbox emulates the Visual Editor, letting you view the field plugin while developing.