CINXE.COM

<!doctype html> <html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-dev-docs/plugins/development/create-a-plugin"> <head> <meta charset="UTF-8"> <meta name="generator" content="Docusaurus v2.4.0"> <title data-rh="true">Plugin creation &amp; setup | Strapi 5 Documentation</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://docs.strapi.io/dev-docs/plugins/development/create-a-plugin"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Plugin creation &amp; setup | Strapi 5 Documentation"><meta data-rh="true" name="description" content="Learn how to use the Plugin SDK to build and publish a Strapi plugin"><meta data-rh="true" property="og:description" content="Learn how to use the Plugin SDK to build and publish a Strapi plugin"><link data-rh="true" rel="icon" href="https://strapi.io/assets/favicon-32x32.png"><link data-rh="true" rel="canonical" href="https://docs.strapi.io/dev-docs/plugins/development/create-a-plugin"><link data-rh="true" rel="alternate" href="https://docs.strapi.io/dev-docs/plugins/development/create-a-plugin" hreflang="en"><link data-rh="true" rel="alternate" href="https://docs.strapi.io/dev-docs/plugins/development/create-a-plugin" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://392RJ63O14-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" title="Strapi 5 Documentation" href="/opensearch.xml"> <link rel="preconnect" href="https://www.googletagmanager.com"> <script>window.dataLayer=window.dataLayer||[]</script> <script>!function(e,t,a,n,g){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var m=t.getElementsByTagName(a)[0],r=t.createElement(a);r.async=!0,r.src="https://www.googletagmanager.com/gtm.js?id=GTM-WT49VGT",m.parentNode.insertBefore(r,m)}(window,document,"script","dataLayer")</script> <script src="/js/hotjar.js" type="module" async></script> <script src="/js/particle.js" type="module" async></script> <script src="/js/firework.js" type="module" async></script> <script src="/js/ball.js" type="module" async></script> <script src="/js/bar.js" type="module" async></script> <script src="/js/game.js" type="module" async></script> <script src="/js/particleProfiles.js" type="module" async></script> <script src="/js/ext-signals.js" async></script> <script src="https://widget.kapa.ai/kapa-widget.bundle.js" data-website-id="f1838a12-ad58-4224-9fab-2f0704eeeb52" data-project-name="Strapi" data-project-logo="https://strapi.io/assets/favicon-32x32.png" data-button-hide="true" data-modal-disclaimer="Disclaimer: Answers are AI-generated and might be inaccurate. Please ensure you double-check the information provided by visiting source pages." data-project-color="#4945FF" data-button-bg-color="#32324D" data-modal-override-open-class="kapa-widget-button" data-modal-title-ask-ai="Ask your question" async></script><link rel="stylesheet" href="/assets/css/styles.9a425541.css"> <link rel="preload" href="/assets/js/runtime~main.80016a34.js" as="script"> <link rel="preload" href="/assets/js/main.f05489c7.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}(),document.documentElement.setAttribute("data-announcement-bar-initially-dismissed",function(){try{return"true"===localStorage.getItem("docusaurus.announcement.dismiss")}catch(t){}return!1}())</script> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WT49VGT" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><div id="__docusaurus"> <div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#docusaurus_skipToContent_fallback">Skip to main content</a></div><div class="announcementBar_mb4j" style="background-color:#F3E5FA;color:#091E42" role="banner"><div class="announcementBarPlaceholder_vyr4"></div><div class="content_knG7 announcementBarContent_xLdY">You are viewing the Strapi 5 docs 🥳 Don't panic! Strapi v4 is still supported until March 2026. Strapi v4 docs are now hosted at <a target="_blank" rel="noopener noreferrer" href="https://docs-v4.strapi.io">docs-v4.strapi.io</a>.</div><button type="button" aria-label="Close" class="clean-btn close closeButton_CVFx announcementBarClose_gvF7"><svg viewBox="0 0 15 15" width="14" height="14"><g stroke="currentColor" stroke-width="3.1"><path d="M.75.75l13.5 13.5M14.25.75L.75 14.25"></path></g></svg></button></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/logo-v5.png" alt="Strapi Documentation Logo" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/logo-v5-dark.png" alt="Strapi Documentation Logo" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/dev-docs/quick-start">Quick Start Guide</a><a class="navbar__item navbar__link" href="/user-docs/intro">User Guide</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/dev-docs/intro">Developer Docs</a><a class="navbar__item navbar__link" href="/cloud/intro">Cloud Documentation</a><a class="navbar__item navbar__link" href="/release-notes">Release Notes</a></div><div class="navbar__items navbar__items--right"><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="searchBox_ZlJk"><div class="my-custom-search-bar"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button><button class="kapa-widget-button"><span class="kapa-widget-button-text">Ask AI</span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 79.443 112.5" style="enable-background:new 0 0 79.443 90" xml:space="preserve"><path d="M65.455,9.581C57.982,3.155,48.824-0.004,39.736,0C28.476-0.004,17.27,4.845,9.428,14.216 C3.095,21.771-0.004,31.032,0,40.218C-0.004,51.105,4.353,61.96,12.841,69.849L12.132,90l5.156-3.45l11.448-7.66 c3.617,1.052,7.314,1.568,10.979,1.568c11.471,0,22.627-5.042,30.303-14.212c6.326-7.558,9.428-16.818,9.424-26.001 C79.447,28.874,74.699,17.538,65.455,9.581z M65.152,62.172c-6.463,7.721-15.816,11.94-25.436,11.94 c-3.502,0-7.034-0.56-10.476-1.712l-1.479-0.494l-8.848,5.923l0.374-10.764l-1.154-0.992C10.352,59.371,6.346,49.844,6.342,40.218 c0.004-7.772,2.609-15.555,7.948-21.927c6.622-7.904,15.987-11.94,25.446-11.944c7.628,0.004,15.281,2.63,21.578,8.044 c7.783,6.701,11.777,16.229,11.783,25.854C73.091,48.014,70.488,55.796,65.152,62.172z M35.397,61.614h7.686v-7.635h-7.686V61.614z M46.552,23.689c-2.246-1.156-4.857-1.735-7.833-1.735c-3.403,0-6.263,0.927-8.577,2.776c-2.742,2.215-4.112,5.486-4.112,9.816 h7.434v-0.05c0-1.652,0.348-3.007,1.042-4.064c0.958-1.421,2.512-2.132,4.66-2.132c1.322,0,2.447,0.347,3.371,1.04 c1.156,0.96,1.736,2.413,1.736,4.363c0,1.223-0.299,2.313-0.893,3.272c-0.496,0.859-1.289,1.701-2.381,2.528 c-2.313,1.586-3.817,3.156-4.51,4.71c-0.595,1.289-0.894,3.338-0.894,6.146h6.992c0-1.851,0.246-3.238,0.744-4.164 c0.396-0.76,1.223-1.569,2.479-2.429c2.182-1.62,3.734-3.124,4.66-4.512c1.123-1.652,1.686-3.586,1.686-5.801 C52.156,28.863,50.289,25.607,46.552,23.689z"></path></svg></button></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG menuWithAnnouncementBar_GW3s"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/dev-docs/intro"><span class="menu__link__content">🚀 Getting Started</span><span aria-label="Toggle the collapsible sidebar category &#x27;🚀 Getting Started&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/intro"><span class="menu__link__content">Introduction</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/quick-start"><span class="menu__link__content">Quick Start Guide</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/whats-new"><span class="menu__link__content">What&#x27;s new?</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/faq"><span class="menu__link__content">FAQ</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/community"><span class="menu__link__content">Community &amp; Support</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/usage-information"><span class="menu__link__content">Usage information</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/dev-docs/setup-deployment"><span class="menu__link__content">⚙️ Setup &amp; Deployment</span><span aria-label="Toggle the collapsible sidebar category &#x27;⚙️ Setup &amp; Deployment&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/setup-deployment"><span class="menu__link__content">Introduction to Setup &amp; Deployment</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/installation"><span class="menu__link__content">Installation</span><span aria-label="Toggle the collapsible sidebar category &#x27;Installation&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/project-structure"><span class="menu__link__content">Project structure</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" tabindex="0" href="/dev-docs/configurations"><span class="menu__link__content">Configuration</span><span aria-label="Toggle the collapsible sidebar category &#x27;Configuration&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/deployment"><span class="menu__link__content">Deployment</span><span aria-label="Toggle the collapsible sidebar category &#x27;Deployment&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/dev-docs/api/content-api"><span class="menu__link__content">📦 Content API</span><span aria-label="Toggle the collapsible sidebar category &#x27;📦 Content API&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/api/content-api"><span class="menu__link__content">APIs Introduction &amp; Concepts</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/api/rest"><span class="menu__link__content">REST API</span><span aria-label="Toggle the collapsible sidebar category &#x27;REST API&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/api/graphql"><span class="menu__link__content">GraphQL API</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/api/document-service"><span class="menu__link__content">Document Service API</span><span aria-label="Toggle the collapsible sidebar category &#x27;Document Service API&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/dev-docs/advanced-features"><span class="menu__link__content">🔧 Advanced features</span><span aria-label="Toggle the collapsible sidebar category &#x27;🔧 Advanced features&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/advanced-features"><span class="menu__link__content">Introduction to advanced features</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/i18n"><span class="menu__link__content">Internationalization (i18n)</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/cli"><span class="menu__link__content">Command Line Interface</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/typescript"><span class="menu__link__content">TypeScript</span><span aria-label="Toggle the collapsible sidebar category &#x27;TypeScript&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/providers"><span class="menu__link__content">Providers</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/templates"><span class="menu__link__content">Templates</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/data-management"><span class="menu__link__content">Data management</span><span aria-label="Toggle the collapsible sidebar category &#x27;Data management&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/database-migrations"><span class="menu__link__content">Database migrations</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/database-transactions"><span class="menu__link__content">Database transactions</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/testing"><span class="menu__link__content">Testing</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/error-handling"><span class="menu__link__content">Error handling</span></a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/dev-docs/customization"><span class="menu__link__content">🛠 Customization</span><span aria-label="Toggle the collapsible sidebar category &#x27;🛠 Customization&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/customization"><span class="menu__link__content">Customization Introduction &amp; Concepts</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/backend-customization"><span class="menu__link__content">Back-end customization</span><span aria-label="Toggle the collapsible sidebar category &#x27;Back-end customization&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/admin-panel-customization"><span class="menu__link__content">Admin panel customization</span><span aria-label="Toggle the collapsible sidebar category &#x27;Admin panel customization&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/dev-docs/plugins"><span class="menu__link__content">🔌 Plugins</span><span aria-label="Toggle the collapsible sidebar category &#x27;🔌 Plugins&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/plugins"><span class="menu__link__content">Plugins Introduction &amp; Concepts</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/plugins/using-plugins"><span class="menu__link__content">Using plugins</span><span aria-label="Toggle the collapsible sidebar category &#x27;Using plugins&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/dev-docs/plugins/developing-plugins"><span class="menu__link__content">Developing plugins</span><span aria-label="Toggle the collapsible sidebar category &#x27;Developing plugins&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/plugins/developing-plugins"><span class="menu__link__content">Introduction to developing plugins</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/dev-docs/plugins/development/create-a-plugin"><span class="menu__link__content">Plugin creation &amp; setup</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/plugins/development/plugin-structure"><span class="menu__link__content">Plugin structure</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/plugins/development/plugin-sdk"><span class="menu__link__content">Plugin SDK</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/dev-docs/plugins/admin-panel-api"><span class="menu__link__content">Admin Panel API</span><span aria-label="Toggle the collapsible sidebar category &#x27;Admin Panel API&#x27;" role="button" class="clean-btn menu__caret"></span></a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/plugins/server-api"><span class="menu__link__content">Server API</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/custom-fields"><span class="menu__link__content">Custom fields</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/plugins-extension"><span class="menu__link__content">Plugins extension</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-3 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/dev-docs/plugins/developing-plugins"><span class="menu__link__content">Guides</span><span aria-label="Toggle the collapsible sidebar category &#x27;Guides&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/plugins/guides/store-and-access-data"><span class="menu__link__content">Store and access data</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/plugins/guides/pass-data-from-server-to-admin"><span class="menu__link__content">Pass data from server to admin</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-4 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/dev-docs/plugins/development/create-a-plugin"><span class="menu__link__content">Plugin creation &amp; setup</span></a></li></ul></li></ul></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/dev-docs/upgrades"><span class="menu__link__content">♻️ Upgrades</span><span aria-label="Toggle the collapsible sidebar category &#x27;♻️ Upgrades&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/upgrades"><span class="menu__link__content">Introduction to upgrades</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/upgrade-tool"><span class="menu__link__content">Upgrade tool reference</span></a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" tabindex="0" href="/dev-docs/migration/v4-to-v5/introduction-and-faq"><span class="menu__link__content">Upgrade to Strapi 5</span><span aria-label="Toggle the collapsible sidebar category &#x27;Upgrade to Strapi 5&#x27;" role="button" class="clean-btn menu__caret"></span></a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/migration/v4-to-v5/introduction-and-faq"><span class="menu__link__content">Introduction and FAQ</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/migration/v4-to-v5/step-by-step"><span class="menu__link__content">Step-by-step guide</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/migration/v4-to-v5/breaking-changes"><span class="menu__link__content">Breaking changes list</span></a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/dev-docs/migration/v4-to-v5/additional-resources/introduction"><span class="menu__link__content">Specific resources</span></a></li></ul></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/dev-docs/plugins"><span itemprop="name">🔌 Plugins</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/dev-docs/plugins/developing-plugins"><span itemprop="name">Developing plugins</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Plugin creation &amp; setup</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Plugin creation</h1><p>There are many ways to create a Strapi 5 plugin, but the fastest and recommended way is to use the Plugin SDK.</p><p>The Plugin SDK is a set of commands orientated around developing plugins to use them as local plugins or to publish them on NPM and/or submit them to the Marketplace.</p><p>With the Plugin SDK, you do not need to set up a Strapi project before creating a plugin.</p><p>The present guide covers creating a plugin from scratch, linking it to an existing Strapi project, and publishing the plugin. If you already have an existing plugin, you can instead retrofit the plugin setup to utilise the Plugin SDK commands (please refer to the <a href="/dev-docs/plugins/development/plugin-sdk">Plugin SDK reference</a> for a full list of available commands).</p><div class="theme-admonition theme-admonition--note"><div class="theme-admonition__heading"><span class="theme-admonition__heading__icon">✏️<!-- --> </span>Note</div><p>This guide assumes you want to develop a plugin external to your Strapi project. However, the steps largely remain the same if you want to develop a plugin within your existing project. If you are not <a href="#working-with-the-plugin-cli-in-a-monorepo-environment">using a monorepo</a> the steps are exactly the same.</p></div><div class="theme-admonition theme-admonition--prerequisites"><div class="theme-admonition__heading"><span class="theme-admonition__heading__icon">☑️<!-- --> </span>Prerequisites</div><p><a href="https://www.npmjs.com/package/yalc" target="_blank" rel="noopener noreferrer">yalc</a> must be installed globally (with <code>npm install -g yalc</code> or <code>yarn global add yalc</code>).</p></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="getting-started-with-the-plugin-sdk">Getting started with the Plugin SDK<a href="#getting-started-with-the-plugin-sdk" class="hash-link" aria-label="Direct link to Getting started with the Plugin SDK" title="Direct link to Getting started with the Plugin SDK">​</a></h2><p>The Plugin SDK helps you creating a plugin, linking it to an existing Strapi project, and building it for publishing.</p><p>The full list of commands and their parameters are available in the <a href="/dev-docs/plugins/development/plugin-sdk">Plugin SDK reference</a>. The present page will guide on using the main ones.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="creating-the-plugin">Creating the plugin<a href="#creating-the-plugin" class="hash-link" aria-label="Direct link to Creating the plugin" title="Direct link to Creating the plugin">​</a></h3><p>To create your plugin, ensure you are in the parent directory of where you want it to be created and run the following command:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">NPM</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> dlx @strapi/sdk-plugin init my-strapi-plugin</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">npx @strapi/sdk-plugin init my-strapi-plugin</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The path <code>my-strapi-plugin</code> can be replaced with whatever you want to call your plugin, including the path to where it should be created (e.g., <code>code/strapi-plugins/my-new-strapi-plugin</code>).</p><p>You will be ran through a series of prompts to help you setup your plugin. If you selected yes to all options the final structure will be similar to the default <a href="/dev-docs/plugins/development/plugin-structure">plugin structure</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="linking-the-plugin-to-your-project">Linking the plugin to your project<a href="#linking-the-plugin-to-your-project" class="hash-link" aria-label="Direct link to Linking the plugin to your project" title="Direct link to Linking the plugin to your project">​</a></h3><p>In order to test your plugin during its development, the recommended approach is to link it to a Strapi project.</p><p>Linking your plugin to a project is done with the <code>watch:link</code> command. The command will output explanations on how to link your plugin to a Strapi project.</p><p>In a new terminal window, run the following commands:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">NPM</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token builtin class-name" style="color:rgb(189, 147, 249)">cd</span><span class="token plain"> /path/to/strapi/project</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> dlx yalc </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> --link my-strapi-plugin </span><span class="token operator">&amp;&amp;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">install</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token builtin class-name" style="color:rgb(189, 147, 249)">cd</span><span class="token plain"> /path/to/strapi/project</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">npx yalc </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> --link my-strapi-plugin </span><span class="token operator">&amp;&amp;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">install</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition--note"><div class="theme-admonition__heading"><span class="theme-admonition__heading__icon">✏️<!-- --> </span>Note</div><p>In the above examples we use the name of the plugin (<code>my-strapi-plugin</code>) when linking it to the project. This is the name of the package, not the name of the folder.</p></div><p>Because this plugin is installed via <code>node_modules</code> you won&#x27;t need to explicity add it to your <code>plugins</code> <a href="/dev-docs/configurations/plugins">configuration file</a>, so running the <a href="/dev-docs/cli#strapi-develop"><code>develop command</code></a> to start your Strapi project will automatically pick up your plugin.</p><p>Now that your plugin is linked to a project, run <code>yarn develop</code> or <code>npm run develop</code> to start the Strapi application.</p><p>You are now ready to develop your plugin how you see fit! If you are making server changes, you will need to restart your server for them to take effect.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="building-the-plugin-for-publishing">Building the plugin for publishing<a href="#building-the-plugin-for-publishing" class="hash-link" aria-label="Direct link to Building the plugin for publishing" title="Direct link to Building the plugin for publishing">​</a></h3><p>When you are ready to publish your plugin, you will need to build it. To do this, run the following command:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Yarn</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">NPM</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> build </span><span class="token operator">&amp;&amp;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> verify</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> run build </span><span class="token operator">&amp;&amp;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> run verify</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The above commands will not only build the plugin, but also verify that the output is valid and ready to be published. You can then publish your plugin to NPM as you would any other package.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="working-with-the-plugin-sdk-in-a-monorepo-environment">Working with the Plugin SDK in a monorepo environment<a href="#working-with-the-plugin-sdk-in-a-monorepo-environment" class="hash-link" aria-label="Direct link to Working with the Plugin SDK in a monorepo environment" title="Direct link to Working with the Plugin SDK in a monorepo environment">​</a></h2><p>If you are working with a monorepo environment to develop your plugin, you don&#x27;t need to use the <code>watch:link</code> command because the monorepo workspace setup will handle the symlink. You can use the <code>watch</code> command instead.</p><p>However, if you are writing admin code, you might add an <code>alias</code> that targets the source code of your plugin to make it easier to work with within the context of the admin panel:</p><div class="language-ts codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-ts codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> path </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;node:path&#x27;</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">export</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">default</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> webpack</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">resolve</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">alias </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token operator">...</span><span class="token plain">config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">resolve</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">alias</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">&#x27;my-strapi-plugin&#x27;</span><span class="token operator">:</span><span class="token plain"> path</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">resolve</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> __dirname</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// We&#x27;ve assumed the plugin is local.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">&#x27;../plugins/my-strapi-plugin/admin/src&#x27;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition--caution"><div class="theme-admonition__heading"><span class="theme-admonition__heading__icon">✋<!-- --> </span>Caution</div><p>Because the server looks at the <code>server/src/index.ts|js</code> file to import your plugin code, you must use the <code>watch</code> command otherwise the code will not be transpiled and the server will not be able to find your plugin.</p></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-tags-row row margin-bottom--sm"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/tags/guides">guides</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/tags/plugins">plugins</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/tags/plugin-sdk">Plugin SDK</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/tags/plugins-development">plugins development</a></li></ul></div></div><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/strapi/documentation/edit/main/docusaurus/docs/dev-docs/plugins/development/create-a-plugin.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Contribute to this page on GitHub</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/dev-docs/plugins/developing-plugins"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Developing plugins</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/dev-docs/plugins/development/plugin-structure"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Plugin structure</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#getting-started-with-the-plugin-sdk" class="table-of-contents__link toc-highlight">Getting started with the Plugin SDK</a><ul><li><a href="#creating-the-plugin" class="table-of-contents__link toc-highlight">Creating the plugin</a></li><li><a href="#linking-the-plugin-to-your-project" class="table-of-contents__link toc-highlight">Linking the plugin to your project</a></li><li><a href="#building-the-plugin-for-publishing" class="table-of-contents__link toc-highlight">Building the plugin for publishing</a></li></ul></li><li><a href="#working-with-the-plugin-sdk-in-a-monorepo-environment" class="table-of-contents__link toc-highlight">Working with the Plugin SDK in a monorepo environment</a></li></ul></div></div></div></div></main></div></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Additional resources</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://docs-v4.strapi.io" target="_blank" rel="noopener noreferrer" class="footer__link-item">v4 Docs<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://contributor.strapi.io" target="_blank" rel="noopener noreferrer" class="footer__link-item">Contributor Docs<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://design-system.strapi.io/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Strapi Design System<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://docs-v3.strapi.io" target="_blank" rel="noopener noreferrer" class="footer__link-item">v3 Docs (unsupported)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">Community</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://discord.strapi.io/" target="_blank" rel="noopener noreferrer" class="footer__link-item">Discord<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://twitter.com/strapijs" target="_blank" rel="noopener noreferrer" class="footer__link-item">Twitter<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://stackoverflow.com/questions/tagged/strapi" target="_blank" rel="noopener noreferrer" class="footer__link-item">Stack Overflow<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><div class="col footer__col"><div class="footer__title">More</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://strapi.io/blog" target="_blank" rel="noopener noreferrer" class="footer__link-item">Blog</a></li><li class="footer__item"><a href="https://github.com/strapi/documentation" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://strapi.io" target="_blank" rel="noopener noreferrer" class="footer__link-item">Strapi.io<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div></div></footer></div> <script src="/assets/js/runtime~main.80016a34.js"></script> <script src="/assets/js/main.f05489c7.js"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10