cloudinary / js-url-gen

Cloudinary's base javascript library, including URL generation.
https://www.cloudinary.com
MIT License
47 stars 9 forks source link

Where can I find the correct import statements? #542

Closed RedFour closed 2 years ago

RedFour commented 2 years ago

The lack of documentation on import statement is frustrating. For example: https://cloudinary.com/blog/adaptive_browser_based_image_format_delivery

I know this is what I need .delivery(quality(auto()));

But there is no documentation on where the import for quality is.

atdcloud commented 2 years ago

Hi @RedFour,

Please check out our reference page: https://cloudinary.com/documentation/sdks/js/transformation-builder/list_namespace.html#Quality

In your use case, it will be the following code:

import {Cloudinary} from "@cloudinary/url-gen";
import {quality} from "@cloudinary/url-gen/actions/delivery";
import {quality} from "@cloudinary/url-gen/qualifiers/quantity";

const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
const image = yourCldInstance.image('woman');
image.delivery(
    quality('auto'),
);

the reference here: https://cloudinary.com/documentation/sdks/js/transformation-builder/Actions.Delivery.html#.quality

I hope this helps.