Install plugin from private repository

Hi,

I’m looking to develop my own plugin, like any other plugin, i don’t want to save it in my main strapi project.

I versionned it into a giltab private repo, but when i run my main strapi app with my plugin as a dependancie, is not appear. It is present in the node_modules directory, but it doesnt generate my models and it is not available in the admin dashboard.

I try this plugin as a local plugin and it works, model is generated and i can access it in my admin dashboard.

So my question is how to to use and install a strapi plugin versionned from a private repository ? Is there any configuration to make it works as a local plugin ?

Thanks!

Make sure that your gitlab configuration is configured properly. Seems that is related only on how you configured the gitlab package.

Try to create a fresh node.js app, which contains just a index.js file and add any private repository to it’s dependencies to make sure that your gitlab packages are working.

My package is downloaded, i can check its sources into node_modules folder. I don’t have any issue when i run yarn install.

Is there any options that i must check before installing my package ? It is import with my private ssh key.

No, there is no need to configure something extra.

There are just a three mandatory things:

  • Plugin’s name must begin with strapi-plugin-, example: strapi-plugin-test
  • It should be added to package.json
  • plugin’s package.json should contain the same name as your plugin, example
    "name": "strapi-plugin-test",

I just added it to package.json and used yarn install and it works.

"dependencies": {
    //...
    "strapi-plugin-test": "git+https://<token-name>:<token>@gitlab.com/Username/Repository#{branch|tag}",
    //...
}

image

I add an empty bootstrap.js file and it works.
I don’t know what this file is supposed to change ?