# Plugins development

Strapi allows the development of local plugins that work exactly like the external plugins available from the Marketplace (opens new window).

🤓 Extending plugins

If you would rather extend an existing plugin than create a new one, see the Plugins extension documentation.

# Create a plugin

Strapi provides a command line interface (CLI) for creating plugins. To create a plugin:

  1. Navigate to the root of a Strapi project.
  2. Run yarn strapi generate or npm run strapi generate in a terminal window to start the interactive CLI.
  3. Choose "plugin" from the list, press Enter, and give the plugin a name in kebab-case (e.g. my-plugin-name)
  4. Choose either JavaScript or TypeScript for the plugin language.
  5. Enable the plugin by adding it to the plugins configurations file:
  1. (TypeScript-specific) Run npm install or yarn install in the newly-created plugin directory.
  2. (TypeScript-specific) Run yarn build or npm run build in the plugin directory. This step transpiles the JavaScript files in a dist directory unique to the plugin.
  3. Run yarn build or npm run build at the project root.
  4. Run yarn develop or npm run develop at the project root.

Plugins created using the preceding directions are located in the plugins directory of the application (see project structure).

✏️ NOTE

During plugin development it is helpful to use the --watch-admin flag to toggle hot reloading of the admin panel. See the Admin panel customization documentation for more details. TypeScript projects need to additionally run the yarn develop or npm run developcommand in the plugin directory to enable hot reloading.

# Add features to a plugin

Strapi provides programmatic APIs for plugins to hook into some of Strapi's features.

Plugins can register with the server and/or the admin panel, by looking for entry point files at the root of the package: