Cloudinary's Upload API allows you to quickly upload your images, videos and other media files to Cloudinary for immediate deliverability. Let's show you how to use this API in your development environment.
This video is brought to you by Cloudinary's video player - embed your own!
Use the controls to set the playback speed, navigate to chapters of interest and select subtitles in your preferred language.
You can find the code from this tutorial in
GitHub.
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
|
|
0:32 |
Start writing a script that uses Cloudinary's Upload API to get the image into your Cloudinary product environment. Our example requires two different libraries - the Cloudinary Node.js SDK and dotenv, which allows your development environment to use your Cloudinary credentials and upload the assets in an authenticated way. |
|
|
|
|
0:50 |
Copy the API environment variable format from the API Keys page of the Cloudinary Console Settings. Replace <your_api_key> and <your_api_secret> with your actual values. Your cloud name is already correctly included in the format. Then, paste the environment variable into a .env file in your development project. Do not expose your Cloudinary product environment credentials in your site's frontend and public code. |
|
|
|
|
1:26 |
Make sure all of our script's libraries are properly installed with a simple npm i command. If you opening your package.json file, you can see all of the packages have been listed as dependencies. |
|
|
|
|
1:41 |
You should have gotten a successful JSON response with lots of data about the uploaded file, including its resolution, file size, format, and more. The file is also now an immediately deliverable asset from a secure, HTTPS URL. |
|
|
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.