Cloudinary is a comprehensive media management platform that helps streamline the process of uploading, storing, managing, and delivering digital media content. With its robust capabilities for optimizing and transforming images and videos on-the-fly, it ensures they are delivered efficiently across various devices and platforms.
Cloudinary's powerful APIs and user-friendly interface enable developers and content creators to seamlessly integrate media management into their workflows, enhancing performance and user experience.
The Contentstack Marketplace lets you install the Cloudinary app and use it within your stack to refer media files from your Cloudinary account.
This step-by-step guide explains how to install and configure Cloudinary within your stack.
To get your Cloud Name and API Key from Cloudinary, follow the steps given below:


Note: To view the restricted assets, you need to configure the Access Control Key in step 2. Please contact the Cloudinary Support team to get this credential.
To install the app, log in to your Contentstack account and follow the steps:





Alternatively, you can set a configuration as the default by clicking three dots on the top-right side of the configuration section and then selecting Set As Default.
Note: At least one store configuration should be selected as the default.
In the Confirm Deletion modal, add the configuration name and click Delete.
Similarly, you can add multiple configurations by following the steps discussed above.
Warning: When you change the settings from All Fields to Custom Fields, and vice versa, any existing assets will follow the old configuration settings, whereas newly added assets in the entry will store the data according to the updated configuration settings.
If you select Custom Fields then the Cloudinary Keys drop-down appears in which id, public_id, access_control, secure_url, and derived[0].secure_url Cloudinary Keys options are selected by default. If you want to create a new key, click the + New Key Field option.
In the Add Cloudinary Key Path modal, enter the Cloudinary Key Path and click the Create or Create and Apply button to create a new key.
You can map nested or complex structures in the following manner:
For example, Object.age for accessing the age field within the object.
For example, Array[1] for accessing the second value of an array.
You can use the above rules to create mapping rules for complex structures that include objects and arrays. All Cloudinary fields are supported through this feature.
Example: Cloudinary Object
{
"public_id": "mens_nyfw_banner_efpxor",
"resource_type": "image",
"tags": ["mensignal", "womenwear"],
"metadata": { "product_id": "0" },
}
eg: tags[1] and metadata.product_id Note: The Choose the Cloudinary keys to Save in Entry feature is applicable to Cloudinary Custom Fields only.
Note: The app requires at least one UI location to be enabled, otherwise you will not be able to save your app configuration settings.
Additional Resource: For more information on UI locations and webhooks, please refer to the Installed Apps guide.
To use the Cloudinary app within an entry of your stack, follow the steps given below:

There are two ways to use the Cloudinary app in your entry.
Change the Display Name of the custom field to your choice, for example, Cloudinary Custom Field. Optionally, you can add Help Text and Instruction Value for your custom field. This adds the Cloudinary app in the custom field.
The key:value passed in the configuration object overrides the default app configuration settings.
In case you want to use a different Cloudinary configuration for any Custom field within the same stack, you need to specify the configuration name in the Config Parameter.
Configuration Object:
{
"config_label": [
"config2"
]
}Locale Based Configuration Object: To add a locale-based configuration, add a locale parameter to the additional configuration object which specifies the locale value (for example: en-us) as the object key and the configuration object as the value to the locale.
{
"config_label": [
"config2"
],
"locale": {
"en-us": {
"config_label": [
"config3"
]
},
"fr-fr": {
"config_label": [
"config1"
]
}
}
}Asset Validations: Only those asset will be added in the Custom field that satisfy the advance config constraints for size, height, and width.
{
"advanced": {
"size": {
"max": 10,
"min": 5
},
"height": {
"max": 10,
"min": 5,
"exact": 25
},
"width": {
"max": 10,
"min": 5,
"exact": 25
}
}
}Max Limit: You can set the maximum number of assets that can be added in the Custom field. In our example, it is 5.
{
"advanced": {
"max_limit":5
}
}Custom Settings: We have added an object, named custom_settings, which includes the following keys in the given format:
{
"custom_settings": {
"compact_view_options": {
"folder": {
"path":"demo_assets/sample",
"resource_type":"image"
}
}
}
}Additional Resource: You can add more optional parameters within the compact_view_options object. For detailed description of these optional parameters, refer to the Cloudinary Media Library Widget documentation.
You will see the Cloudinary app added as a custom field in your entry page as shown below:


Note: If you have set the Config Parameter in the Custom Field Advanced Properties, you will directly land to the selected folder.
You can also add transformed assets. Transformed Assets are the files (such as images, videos, etc.) that have been modified or processed using Cloudinary's extensive transformation capabilities. These transformations can include resizing, cropping, format conversion, applying effects, watermarking, and more.
Select the image, click the three ellipses, then click Open from the list, you can see several transformed options under the Templates heading. You can create a new template or select the transformed asset and click the corresponding Insert button to add it to the Custom field.
You can also add restricted assets in the Custom field.
Note: To successfully add and view private images to the Custom field, make sure to configure the Access Control Key in step 2.
The assets you insert are referenced within your entry in the thumbnail view, by default.
To change the assets view, select List from the drop-down menu as shown in the following screenshot:
The assets you insert get referenced within your entry in the list view.
Note: Once you add the maximum number of assets, as defined in config parameter, the Choose Assets button becomes disabled. You cannot add more assets than the preconfigured limit in the Custom field.
When the Access Control Key is no longer served, the private assets become restricted to the user.
Thumbnail View
List View
To add the Config Parameter in the JSON RTE field, click the gear icon on the app plugin selector page.
You can set the following validations for the JSON RTE field:
In case you want to use a different Cloudinary configuration for any JSON RTE field within the same stack, you need to specify the configuration name in the Config Parameter.
{
"config_label": [
"config 2"
]
}Asset Validations: Only those assets will be added in the JSON RTE field that satisfy the advance config constraints for size, height, and width.
{
"advanced": {
"size": {
"max": 10,
"min": 5
},
"height": {
"max": 10,
"min": 5,
"exact": 25
},
"width": {
"max": 10,
"min": 5,
"exact": 25
}
}
}Custom Settings: We have added an object, named custom_settings, which includes the following keys in the given format:
{
"custom_settings": {
"compact_view_options": {
"folder": {
"path":"demo_assets/sample",
"resource_type":"image"
}
}
}
}Additional Resource: You can add more optional parameters within the compact_view_options object. For detailed description of these optional parameters, refer to the Cloudinary Media Library Widget documentation.
This adds Cloudinary in the JSON Rich Text Editor.
You will see the Cloudinary app icon inside the JSON RTE field in your entry page as shown below:
Note: If you have set the Config Parameter in the JSON RTE field, you will directly land to the selected folder.
You can also add transformed assets. Transformed Assets are files (such as images, videos, etc.) that have been modified or processed using Cloudinary's extensive transformation capabilities. These transformations can include resizing, cropping, format conversion, applying effects, watermarking, and more.
Select the image, click the three ellipses, and then click Open from the list. You can see several transformed options under the Templates heading. You can create a new template or select the transformed asset and click the corresponding Insert button to add it to the JSON Rich Text Editor field.
You can also add restricted assets in the JSON Rich Text Editor field.
Note: To successfully add and view private images to the JSON Rich Text Editor field, make sure to configure the Access Control Key in step 2.
The selected asset(s) gets displayed in the JSON Rich Text Editor:
When the Access Control Key is no longer served, the private assets become restricted to the user.
Additional Resource: You can use alignment and inline asset features to edit the asset placement within the JSON Rich Text Editor field.
Note: