Cloudinary React SDK
=========================
About
The Cloudinary React SDK allows you to quickly and easily integrate your application with Cloudinary.
Effortlessly optimize and transform your cloud's assets.
#### Note
This Readme provides basic installation and usage information.
For the complete documentation, see the React SDK Guide.
Table of Contents
-
Cloudinary React SDK -
About -
Note -
Table of Contents -
Key Features -
Version Support -
Installation -
Install using your favorite package manager (yarn, npm) -
Usage -
Setup -
Transform and Optimize Assets -
Generate Image and Video HTML Tags -
Advanced Plugin Features -
File upload -
Contributions -
Get Help -
About Cloudinary -
Additional Resources -
LicenseKey Features
-
Transform and
optimize assets.
- Generate
image and
video tags.
Version Support
| SDK Version | React 16 | React 17 | React 18 |
|---------------|------------|----------|----------|
| 1.0.0 & up | V | V | V |
Installation
$3
``
bash
npm i @cloudinary/url-gen @cloudinary/react --save`
Or
`
bash
yarn add @cloudinary/url-gen @cloudinary/react --save
`
Usage
$3
`
javascript
import React from 'react';
import { AdvancedImage } from '@cloudinary/react'
import { Cloudinary } from '@cloudinary/url-gen';
`
$3
- See full documentation`
tsx
import { AdvancedImage } from '@cloudinary/react'
import { Cloudinary } from '@cloudinary/url-gen';const myCld = new Cloudinary({
cloud: {
cloudName: "demo",
},
});
let img = myCld.image('sample');
const App = () => {
return
};
`
$3
- Use to generate image tags
- Use to generate video tags$3
- See full documentation
We recommend the following order when using our plugins to achieve the best results:
`
tsx
import { CloudinaryImage } from "@cloudinary/url-gen";
import {
lazyload,
responsive,
accessibility,
placeholder
} from "@cloudinary/react";cloudinaryImage = new CloudinaryImage("sample", { cloudName: "demo" });
const App = () => {
return ;
};
`
You can omit any plugin, but the order from above should remain.
$3
This SDK does not provide file upload functionality, however there are several methods of uploading from the client side.Contributions
- Ensure tests run locally (`
npm run test``)
- Open a PR and ensure Travis tests pass
Get Help
If you run into an issue or have a question, you can either:
-
Open a Github issue (for issues related to the SDK)
-
Open a support ticket (for issues related to your account)
About Cloudinary
Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive and personalized visual-media experiences—irrespective of the viewing device.
Additional Resources
-
Cloudinary Transformation and REST API References: Comprehensive references, including syntax and examples for all SDKs.
-
MediaJams.dev: Bite-size use-case tutorials written by and for Cloudinary Developers
-
DevJams: Cloudinary developer podcasts on YouTube.
-
Cloudinary Academy: Free self-paced courses, instructor-led virtual courses, and on-site courses.
-
Code Explorers and Feature Demos: A one-stop shop for all code explorers, Postman collections, and feature demos found in the docs.
-
Cloudinary Roadmap: Your chance to follow, vote, or suggest what Cloudinary should develop next.
-
Cloudinary Facebook Community: Learn from and offer help to other Cloudinary developers.
-
Cloudinary Account Registration: Free Cloudinary account registration.
-
Cloudinary Website: Learn about Cloudinary's products, partners, customers, pricing, and more.
License
Released under the MIT license.