5

Can someone tell me how to install Cloudinary to my Strapi app, I installed the plugin like the documentation said but the plugin doesn't show up at all in my project. Can someone tell me what im doing wrong

GentiJ
  • 51
  • 1
  • 3
  • Could you please share more details on which steps from the documentation you're following and how you're including it in your project? – Aleksandar May 13 '20 at 09:33
  • https://strapi.io/documentation/3.0.0-beta.x/plugins/upload.html#using-a-provider Im following this part, Im adding Cloudinary with yarn – GentiJ May 13 '20 at 09:58
  • Im creating new strapi app with quickstart, then registering my admin, after that I stop the server and add that line yarn add strapi-provider-upload-cloudinary, the cloudinary folder appears on node_modules, but thats about it. – GentiJ May 13 '20 at 10:05
  • Once the module is installed, are you including the providers API configuration in `./extensions/upload/config/settings.json` or via the 'per environment' approach? – Aleksandar May 13 '20 at 16:48

1 Answers1

5

There is an example on the strapi documentation: https://strapi.io/documentation/3.0.0-beta.x/plugins/upload.html#using-a-provider To enable the provider for Cloudinary, create or edit the file at ./extensions/upload/config/settings.json

{
  "provider": "cloudinary",
  "providerOptions": {     "cloud_name":"PROVIDER_CLOUD_NAME",
    "api_key": "PROVIDER_API_KEY",               
    "api_secret":"PROVIDER_API_SECRET"
  }
}

Of course you should replace PROVIDER_CLOUD_NAME, PROVIDER_API_KEY, PROVIDER_API_SECRET with appropriate values that can be found on your Cloudinary account. If you want a specific configuration by environment you can edit the file at ./extensions/upload/config/settings.js like this:

if (process.env.NODE_ENV === 'production') {
  module.exports = {
    provider: 'providerName',
    providerOptions: {
      cloud_name: process.env.PROVIDER_CLOUD_NAME,
      api_key: process.env.PROVIDER_API_KEY,
      api_secret: process.env.PROVIDER_API_SECRET
    }
  };
} else {
  // to use the default local provider you can return an empty configuration
  module.exports = {};
}
adrianmr
  • 51
  • 1
  • 5