Skip to content

Commit 8fe5a9e

Browse files
committed
Fix sample README.md
1 parent 488d700 commit 8fe5a9e

File tree

2 files changed

+163
-225
lines changed

2 files changed

+163
-225
lines changed

README.md

Lines changed: 93 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,101 @@
1-
2-
# Cloudinary React Library
3-
4-
Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline.
5-
6-
Easily upload images to the cloud. Automatically perform smart image resizing, cropping and conversion without installing any complex software. Integrate Facebook or Twitter profile image extraction in a snap, in any dimension and style to match your website’s graphics requirements. Images are seamlessly delivered through a fast CDN, and much much more.
7-
8-
Cloudinary offers comprehensive APIs and administration capabilities and is easy to integrate with any web application, existing or new.
9-
10-
Cloudinary provides URL and HTTP based APIs that can be easily integrated with any Web development framework.
1+
Cloudinary React SDK
2+
=========================
3+
## About
4+
The Cloudinary React SDK allows you to quickly and easily integrate your application with Cloudinary.
5+
Effortlessly optimize and transform your cloud's assets.
6+
7+
#### Note
8+
This Readme provides basic installation and usage information.
9+
For the complete documentation, see the [React SDK Guide](https://cloudinary.com/documentation/react1_integration).
10+
11+
12+
## Table of Contents
13+
- [Key Features](#key-features)
14+
- [Version Support](#Version-Support)
15+
- [Installation](#installation)
16+
- [Usage](#usage)
17+
- [Setup](#Setup)
18+
- [Transform and Optimize Assets](#Transform-and-Optimize-Assets)
19+
- [Generate Image and HTML Tags](#Generate-Image-and-Video-HTML-Tags)
20+
21+
## Key Features
22+
- [Transform](https://cloudinary.com/documentation/react1_video_manipulation#video_transformation_examples) and [optimize](https://cloudinary.com/documentation/react1_image_manipulation#image_optimizations) assets.
23+
- Generate [image](https://cloudinary.com/documentation/react1_image_manipulation#deliver_and_transform_images) and [video](https://cloudinary.com/documentation/react1_video_manipulation#video_element) tags.
24+
25+
## Version Support
26+
| SDK Version | React 15.3 | React 16.2 | React 16.3 | React 17 |
27+
|---------------|------------|------------|------------|----------|
28+
| 1.6.8 & up | X | X | V | V |
29+
| 1.2.0 - 1.6.7 | X | X | V | X |
30+
| 1.0.5 - 1.1.4 | X | V | X | X |
31+
| 1.0.0 - 1.0.4 | V | X | X | X |
1132

1233
## Installation
13-
14-
15-
### NPM
16-
17-
1. Install the files using the following command. Use the optional `--save` parameter if you wish to save the dependency in your `bower.json` file.
18-
19-
```shell
20-
npm install cloudinary-react --save
21-
```
22-
23-
1. Include the javascript files in your code. For Example:
24-
25-
```js
26-
import {Image} from 'cloudinary-react';
27-
```
28-
29-
30-
## Setup
31-
32-
In order to properly use this library you have to provide it with a few configuration parameters. All configuration parameters can be applied directly to the element or using a CloudinaryContext element.
33-
34-
35-
```js
36-
ReactDOM.render(
37-
<div>
38-
<h1>Hello, world!</h1>
39-
<Image cloudName="demo" publicId="sample" width="300" crop="scale"/>
40-
// Or for more advanced usage:
41-
// import {CloudinaryContext, Transformation} from 'cloudinary-react';
42-
<CloudinaryContext cloudName="demo">
43-
<Image publicId="sample">
44-
<Transformation width="200" crop="scale" angle="10"/>
45-
</Image>
46-
</CloudinaryContext>
47-
</div>,
48-
document.getElementById('example')
49-
);
34+
### Install using your favorite package manager (yarn, npm)
35+
```bash
36+
npm install cloudinary-react
37+
```
38+
Or
39+
```bash
40+
yarn add cloudinary-react
5041
```
51-
52-
Required:
53-
54-
* `cloudName` - The cloudinary cloud name associated with your Cloudinary account.
55-
56-
Optional:
57-
58-
* `privateCdn`, `secureDistribution`, `cname`, `cdnSubdomain` - Please refer to [Cloudinary Documentation](https://cloudinary.com/documentation/react_integration#3_set_cloudinary_configuration_parameters) for information on these parameters.
59-
6042

6143
## Usage
62-
63-
The library includes 6 Components:
64-
65-
* CloudinaryContext
66-
* Image
67-
* Audio
68-
* Video
69-
* Transformation
70-
* Placeholder - can only be used as child of an Image component
71-
72-
## Components Demo
73-
Storybook for the components is available [here](https://cloudinary.github.io/cloudinary-react/)
74-
75-
### CloudinaryContext
76-
CloudinaryContext allows you to define shared parameters that are applied to all children elements.
77-
78-
### Image
79-
The Image element defines a Cloudinary Image tag.
80-
81-
### Video
82-
The Video element defines a Cloudinary Video tag.
83-
84-
### Transformation
85-
The Transformation element allows you to defined additional transformations on the parent element.
86-
87-
For example:
88-
89-
```
90-
<Image cloudName="demo" publicId="sample">
91-
<Transformation angle="-45"/>
92-
<Transformation effect="trim" angle="45" crop="scale" width="600">
93-
<Transformation overlay="text:Arial_100:Hello" />
94-
</Transformation>
95-
</Image>
44+
### Setup
45+
```javascript
46+
import React from 'react';
47+
import {Image, Video, Transformation} from 'cloudinary-react';
9648
```
9749

98-
99-
The Cloudinary Documentation can be found at:
100-
https://cloudinary.com/documentation/react_integration
101-
102-
## Additional resources
103-
104-
Additional resources are available at:
105-
106-
* [Website](http://cloudinary.com)
107-
* [Documentation](http://cloudinary.com/documentation)
108-
* [Knowledge Base](http://support.cloudinary.com/forums)
109-
* [Image transformations documentation](http://cloudinary.com/documentation/image_transformations)
110-
111-
## Support
112-
113-
You can [open an issue through GitHub](https://github.com/cloudinary/cloudinary_js/issues).
114-
115-
Contact us at [http://cloudinary.com/contact](http://cloudinary.com/contact).
116-
117-
Stay tuned for updates, tips and tutorials: [Blog](http://cloudinary.com/blog), [Twitter](https://twitter.com/cloudinary), [Facebook](http://www.facebook.com/Cloudinary).
118-
119-
## Join the Community ##########################################################
120-
121-
Impact the product, hear updates, test drive new features and more! Join [here](https://www.facebook.com/groups/CloudinaryCommunity).
122-
123-
## Updating github pages
124-
The github pages source is the "gh-pages" branch. To generate updated storybook:
125-
1. Switch to "gh-pages" branch
126-
2. pull from master
127-
3. rebuild storybook by running "npm run build-storybook"
128-
4. commit and push
129-
130-
## License
131-
50+
### Transform and Optimize Assets
51+
- [See full documentation](https://cloudinary.com/documentation/react1_image_manipulation)
52+
53+
```jsx
54+
// Apply a single transformation
55+
<Image cloudName="demo" publicId="sample">
56+
<Transformation crop="scale" width="200" angle="10" />
57+
</Image>
58+
```
59+
60+
```jsx
61+
// Chain (compose) multiple transformations
62+
<Image cloudName="demo" publicId="sample">
63+
<Transformation angle="-45" />
64+
<Transformation effect="trim" angle="45" crop="scale" width="600" />
65+
<Transformation overlay="text:Arial_100:Hello" />
66+
</Image>
67+
```
68+
### Generate Image and Video HTML Tags
69+
- Use <Image> to generate image tags
70+
- Use <Video> to generate video tags
71+
72+
### File upload
73+
This SDK does not provide file upload functionality, however there are [several methods of uploading from the client side](https://cloudinary.com/documentation/react1_image_and_video_upload).
74+
75+
## Contributions
76+
- Ensure tests run locally (```npm run test```)
77+
- Open a PR and ensure Travis tests pass
78+
79+
## Get Help
80+
If you run into an issue or have a question, you can either:
81+
- [Open a Github issue](https://github.com/CloudinaryLtd/cloudinary-react/issues) (for issues related to the SDK)
82+
- [Open a support ticket](https://cloudinary.com/contact) (for issues related to your account)
83+
84+
## About Cloudinary
85+
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.
86+
87+
88+
## Additional Resources
89+
- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references): Comprehensive references, including syntax and examples for all SDKs.
90+
- [MediaJams.dev](https://mediajams.dev/): Bite-size use-case tutorials written by and for Cloudinary Developers
91+
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on YouTube.
92+
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and on-site courses.
93+
- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop for all code explorers, Postman collections, and feature demos found in the docs.
94+
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should develop next.
95+
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to other Cloudinary developers.
96+
- [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration.
97+
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and more.
98+
99+
100+
## Licence
132101
Released under the MIT license.

samples/photo_album/README.md

Lines changed: 70 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,70 @@
1-
Cloudinary React SDK
2-
=========================
3-
## About
4-
The Cloudinary React SDK allows you to quickly and easily integrate your application with Cloudinary.
5-
Effortlessly optimize and transform your cloud's assets.
6-
7-
#### Note
8-
This Readme provides basic installation and usage information.
9-
For the complete documentation, see the [React SDK Guide](https://cloudinary.com/documentation/react1_integration).
10-
11-
12-
## Table of Contents
13-
- [Key Features](#key-features)
14-
- [Version Support](#Version-Support)
15-
- [Installation](#installation)
16-
- [Usage](#usage)
17-
- [Setup](#Setup)
18-
- [Transform and Optimize Assets](#Transform-and-Optimize-Assets)
19-
- [Generate Image and HTML Tags](#Generate-Image-and-Video-HTML-Tags)
20-
21-
## Key Features
22-
- [Transform](https://cloudinary.com/documentation/react1_video_manipulation#video_transformation_examples) and [optimize](https://cloudinary.com/documentation/react1_image_manipulation#image_optimizations) assets.
23-
- Generate [image](https://cloudinary.com/documentation/react1_image_manipulation#deliver_and_transform_images) and [video](https://cloudinary.com/documentation/react1_video_manipulation#video_element) tags.
24-
25-
## Version Support
26-
| SDK Version | React 15.3 | React 16.2 | React 16.3 | React 17 |
27-
|---------------|------------|------------|------------|----------|
28-
| 1.6.8 & up | X | X | V | V |
29-
| 1.2.0 - 1.6.7 | X | X | V | X |
30-
| 1.0.5 - 1.1.4 | X | V | X | X |
31-
| 1.0.0 - 1.0.4 | V | X | X | X |
32-
33-
## Installation
34-
### Install using your favorite package manager (yarn, npm)
35-
```bash
36-
npm install cloudinary-react
37-
```
38-
Or
39-
```bash
40-
yarn add cloudinary-react
41-
```
42-
43-
## Usage
44-
### Setup
45-
```javascript
46-
import React from 'react';
47-
import {Image, Video, Transformation} from 'cloudinary-react';
48-
```
49-
50-
### Transform and Optimize Assets
51-
- [See full documentation](https://cloudinary.com/documentation/react1_image_manipulation)
52-
53-
```jsx
54-
// Apply a single transformation
55-
<Image cloudName="demo" publicId="sample">
56-
<Transformation crop="scale" width="200" angle="10" />
57-
</Image>
58-
```
59-
60-
```jsx
61-
// Chain (compose) multiple transformations
62-
<Image cloudName="demo" publicId="sample">
63-
<Transformation angle="-45" />
64-
<Transformation effect="trim" angle="45" crop="scale" width="600" />
65-
<Transformation overlay="text:Arial_100:Hello" />
66-
</Image>
67-
```
68-
### Generate Image and Video HTML Tags
69-
- Use <Image> to generate image tags
70-
- Use <Video> to generate video tags
71-
72-
### File upload
73-
This SDK does not provide file upload functionality, however there are [several methods of uploading from the client side](https://cloudinary.com/documentation/react1_image_and_video_upload).
74-
75-
## Contributions
76-
- Ensure tests run locally (```npm run test```)
77-
- Open a PR and ensure Travis tests pass
78-
79-
## Get Help
80-
If you run into an issue or have a question, you can either:
81-
- [Open a Github issue](https://github.com/CloudinaryLtd/cloudinary-react/issues) (for issues related to the SDK)
82-
- [Open a support ticket](https://cloudinary.com/contact) (for issues related to your account)
83-
84-
## About Cloudinary
85-
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.
86-
87-
88-
## Additional Resources
89-
- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references): Comprehensive references, including syntax and examples for all SDKs.
90-
- [MediaJams.dev](https://mediajams.dev/): Bite-size use-case tutorials written by and for Cloudinary Developers
91-
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on YouTube.
92-
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and on-site courses.
93-
- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop for all code explorers, Postman collections, and feature demos found in the docs.
94-
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should develop next.
95-
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to other Cloudinary developers.
96-
- [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration.
97-
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and more.
98-
99-
100-
## Licence
101-
Released under the MIT license.
1+
Cloudinary React Photo Album Sample
2+
=======================================
3+
4+
This sample project shows:
5+
6+
1. How to use the Cloudinary React components.
7+
2. How to upload files to Cloudinary in an unsigned manner, using an upload preset.
8+
3. How to use the dynamic list resource in order to maintain a short list of resources aggregated by tags.
9+
4. How to delete an image uploaded from the browser with an unsigned upload. You can find additional details in this [knowledge base article](https://support.cloudinary.com/hc/en-us/articles/202521132-How-to-delete-an-image-from-the-client-side-). Don't forget to set the `Return delete token` setting of your unsigned upload preset to `true`.
10+
11+
## Configuration ##
12+
13+
There are 2 settings you need to change for this demo to work. Copy or rename `src/config/config.js.sample` to `src/config/config.js` and edit the following:
14+
15+
1. **cloud_name** - Should be change to the cloud name you received when you registered for a Cloudinary account.
16+
2. **upload_preset** - You should first "Enable unsigned uploads" in the ["Upload Settings"](https://cloudinary.com/console/settings/upload) of your Cloudinary console and assign the resulting preset name to that field. Note, you may want to tweak and modify the upload preset's parameters.
17+
3. Additionally, in your Cloudinary console in the ["Security Settings"](https://cloudinary.com/console/settings/security) section you should uncheck the "list" item.
18+
19+
## Setup ##
20+
21+
Run `yarn` to install the required dependencies for this module.
22+
23+
## Running ##
24+
25+
Run `yarn start` to build the app and serve it using a local server.
26+
27+
The application is deployed at http://localhost:5000/
28+
29+
## Internals ##
30+
This sample was created using [CRA](https://github.com/facebook/create-react-app).
31+
32+
### Sample main components ###
33+
34+
#### Routing ####
35+
36+
The application has 2 routes:
37+
38+
* **/photos** - Presents a list of images tagged by `myphotoalbum`
39+
* **/photos/new** - Presents an upload control that allows uploading multiple files by a file input or drag-and-grop.
40+
Uploads have a dynamic progress bar. In addition it displays the details of successful uploads.
41+
42+
The default route is set to `/photos`.
43+
44+
#### Main Components ####
45+
> Photo list
46+
* [App.js](src/components/App.js) the application root component. Fetches the displayed list of images.
47+
* [PhotoList.js](src/components/PhotoList.js) displays the list of photos that was set to the state.
48+
* [Photo.js](src/components/Photo.js) displays a single image.
49+
* [PhotoThumbnail.js](src/components/PhotoThumbnails.js) displays the image transformations.
50+
51+
> Photo Upload
52+
* [PhotosUploader.js](src/components/PhotosUploader.js) displays the upload control and lists the properties of the uploaded images once upload completes successfully.
53+
54+
**Important observations**:
55+
* This implementation shows usage of both cloudinary file upload and a react upload control.
56+
* Changes to the title field are sent in the upload request. This is meant to illustrate the possibility of attaching extra meta-data to each upload image.
57+
* The upload control uses the `upload_preset` we configured in Configuration step. This uses the settings defined on Cloudinary side to process the uploaded file.
58+
59+
### Unsigned Upload ###
60+
61+
In order to add images to our photo album that would later be retrievable from the Cloudinary service we must select a tag which will serve as our source for the list. In this case `myphotoalbum`.
62+
While this tag can be set in the upload preset and remain hidden from the client side, in this sample we included it in the request itself to make this sample work without further configuration steps.
63+
64+
### List Resource ###
65+
66+
Cloudinary supports a JSON list resource.
67+
This list represents all resources marked with a specific tag during upload (or later through other APIs).
68+
Whenever a new resource is uploaded with a tag, or an existing resource already tagged is deleted then the list is recalculated.
69+
This enables you to group a list of resources which can be retrieved by a single query. The size of the list is currently limited to 100 entires.
70+
[Learn more](http://cloudinary.com/documentation/image_transformations#client_side_resource_lists)

0 commit comments

Comments
 (0)