import MediaLibProviderNotes from '/docs/snippets/media-library-providers-notes.md'
Cloudinary provider#
The @strapi/provider-upload-cloudinary package lets you store Media Library assets on . This page covers installation and configuration using your Cloudinary cloud name, API key, and API secret.
The Media Library feature is powered by a back-end server package called Upload which leverages the use of providers.
Strapi maintains 3 providers for the Media Library. The present page is about the provider installation and configuration. For other providers, please refer to the list in the Media Library page.
Installation#
To install the official Strapi-maintained Cloudinary provider, run the following command in a terminal:
yarn add @strapi/provider-upload-cloudinary
npm install @strapi/provider-upload-cloudinary --save
Configuration#
Providers configuration is defined in the /config/plugins file. If this file does not exist, create it first. The provider configuration accepts the following entries:
providerto define the provider name (i.e.,cloudinary)providerOptionsto define options that are passed down during the construction of the provider (see for the full list of options)actionOptionsto define options that are passed directly to the parameters to each method respectively. The official Cloudinary documentation lists available options for and .
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
// ...
});
export default ({ env }) => ({
// ...
upload: {
config: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
// ...
});