By RightCO
Allows to easily create components lifecycles the same way API lifecycles are created
released December 17, 2025
npm install strapi-plugin-components-lifecyclesA plugin for Strapi Headless CMS that provides a way to easily create lifecycles for components.
Allows to easily create components lifecycles just like creating for APIs
Currently, Strapi components have the following file strucutre:
/components
/{category1}
{component1}.js
{component2}.js
/{category2}
{component1}.jsThis plugin allows you to create one lifecycles folder inside each category. Inside that folder you are able to create one .(js/ts) file for each component of that same category.
One example:
/components
/{category1}
/lifecycles
{component1}.js
{component1}.jsThe struture above tells the plugin that it will be subscribed to the {component1} the lifecycles exported from the /lifecycles/{component1}.js.
/lifecycles folder;.js files but the plugin also works with .ts files;strapi.db.lifecycles.subscribe method and because of that it does not show any errors when a invalid lifecycle is being exported;The plugin was created and tested on top of Strapi v5.33.0.
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
